Commit Graph

3974 Commits

Author SHA1 Message Date
LemonBoy
ce21a784a4 stage1: More fixes for BE targets
* Fix packed struct alignment
* Adjust some tests
2020-04-13 17:35:14 -04:00
Michael Dusan
20b2457388 only use -nostdinc++ on c++ files
This is a follow-up to d27ef1aaef
and avoids compiler warnings:

    warning: argument unused during compilation: '-nostdinc++'
2020-04-12 01:03:27 -04:00
Andrew Kelley
d27ef1aaef Zig treats -lstdc++ identically to -lc++
Thanks to Michael Dusan for figuring out what was happening here.

closes #5012
2020-04-12 00:50:16 -04:00
Andrew Kelley
a6e288d5fe Merge pull request #4711 from leroycep/feature-file-locks
Add lock option to File.OpenFlags and File.CreateFlags
2020-04-10 15:00:45 -04:00
Timon Kruiper
121307679b Fix generated docs of user code
fff3c1fff4 broke the docs generation for
own user code. This adds a workaround, because all the code in docs/main.js
is relying on the fact that the root package of the main package is the
root package itself.
2020-04-10 14:59:51 -04:00
Vexu
f60e7348d5 add error message for invalid assignment 2020-04-09 11:50:32 +03:00
Andrew Kelley
beae932e0f Merge pull request #4975 from Vexu/param-reassign
Fix missing compile error on assign to slice and array parameters
2020-04-08 21:02:50 -04:00
Andrew Kelley
c45ba49b8b fix formatted printing warning
needed to use ZIG_PRI_u64 instead of %lu
2020-04-08 19:30:18 -04:00
Vexu
b1e44adcba move array and struct const checks to more appropriate places 2020-04-08 14:32:02 +03:00
Andrew Kelley
b3aef49eea zig provides shlwapi.lib for *-windows-gnu
closes #3711
2020-04-08 01:21:00 -04:00
xackus
66b2477ab6 fix lazy value in ir_analyze_instruction_elem_ptr 2020-04-07 18:22:17 -04:00
Vexu
ff0f97a1bc fix missing compile error on assign to slice and array parameters 2020-04-08 00:27:14 +03:00
Andrew Kelley
22dbeab29d Merge pull request #4857 from LemonBoy/fix-4777
Rewrite the bound checks in slice operator
2020-04-07 14:51:25 -04:00
LemonBoy
cc0fca9d83 stage1: Respect the specified name for extern var
Extend the logic used for function definitions to variables.

Closes #4947
2020-04-07 14:48:37 -04:00
Vexu
e62671f643 fix missing const on address of literal 2020-04-07 15:25:44 +03:00
LeRoyce Pearson
798207ec80 Merge branch 'master' into feature-file-locks 2020-04-06 21:51:57 -06:00
Andrew Kelley
41cb49eb58 stage1 fixes to support building with 32-bit mingw-w64 2020-04-06 20:30:34 -04:00
Andrew Kelley
9ed00b3829 provide ___mb_cur_max_func for i386-windows-gnu 2020-04-06 19:26:31 -04:00
Andrew Kelley
64d0960244 zig cc: recognize a few more linker options
* `--major-image-version`
 * `--minor-image-version`
 * `--stack`
2020-04-06 19:13:36 -04:00
LemonBoy
a59d31bd28 ir: Support tuple multiplication 2020-04-06 14:03:43 -04:00
Andrew Kelley
701c03d083 zig uses mingw-w64 to provide -lpsapi 2020-04-05 23:06:47 -04:00
Andrew Kelley
28d9696617 use mingw-w64 to provide -luuid if requested 2020-04-05 23:06:47 -04:00
LemonBoy
f6cdc94a50 ir: Fix error checking for vector ops
The extra logic that's needed was lost during a refactoring, now it
should be fine.
2020-04-05 18:34:31 -04:00
LemonBoy
fe77c38247 ir: Remove unused and commented out code 2020-04-05 18:34:31 -04:00
LemonBoy
d2d97e55cc ir: Support shift left/right on vectors 2020-04-05 18:34:31 -04:00
LemonBoy
2485f30046 ir: Support bitwise not on vectors 2020-04-05 18:34:31 -04:00
LemonBoy
54ffcf95a8 ir: Support div/mod/rem on vector types
Closes #4050
2020-04-05 18:34:31 -04:00
Andrew Kelley
e2dc63644a type_has_one_possible_value takes comptime struct fields into account
Before, type_has_one_possible_value would return false for the value
`.{1}`. But actually, that type is a tuple with a single comptime field.
Such a type, in fact, has one possible value.

This plus the corresponding adjustment to get_the_one_possible_value
solves #3878.
2020-04-05 17:09:01 -04:00
Michaël Larouche
c4a5f519f2 Do not parse native_libc.txt anymore when linking on native target, always run detection of libc.
Fixes #4772
2020-04-05 11:01:35 -04:00
Andrew Kelley
e5d479b06e detect an endless loop when trying to detect native libc installation
closes #4810
2020-04-04 15:03:22 -04:00
Andrew Kelley
52db13738b zig cc looks for native include directories unless -nostdinc
closes #4938
2020-04-04 14:58:24 -04:00
Andrew Kelley
d02838b71a add libutil to zig's glibc support 2020-04-04 14:43:51 -04:00
Andrew Kelley
cf8728aabd Merge pull request #4935 from LemonBoy/stage1-eb
Big-endian fixes for stage1
2020-04-04 13:45:49 -04:00
Andrew Kelley
d73808f3ff remove zig BUILD_INFO hack
Rather than stuffing configuration information into the Zig binary, the
build script reads it from config.h. This solves a problem for package
maintainers and improves the use case of deterministic builds.

closes #3758
2020-04-04 11:57:28 -04:00
LemonBoy
ad2ebc87f2 stage1: Byteswap floats when serializing them 2020-04-04 16:55:24 +02:00
LemonBoy
084c62f5d1 stage1: Fix serialization of ZigValue on BE machines 2020-04-04 14:06:32 +02:00
Michael Dusan
db4c06ce60 stage1: add compile errors for sentinel slicing
closes #3963
2020-04-03 19:05:30 -04:00
Andrew Kelley
cf52f3f99a zig cc: add -allow-shlib-undefined alias 2020-04-03 13:45:16 -04:00
Andrew Kelley
11b50e3ad8 change the default ABI of riscv64-linux-musl
Before, this would cause a link failure when mixing Zig and C code for
RISC-V targets.

Now, the ABIs match and Zig and C code can be mixed successfully.

I will file a follow-up issue for the ability to deal more explicitly
with ABIs.

closes #4863
2020-04-03 13:13:09 -04:00
LemonBoy
855edd2949 ir: Rewrite the bound checks in slice operator
Closes #4777
2020-04-03 10:58:39 +02:00
LeRoyce Pearson
733f1c25bd Fix compile errors in stage2 2020-04-02 23:39:25 -06:00
LeRoyce Pearson
35c462caf0 Merge branch 'master' into feature-file-locks 2020-04-02 21:46:48 -06:00
Andrew Kelley
e7f555ca55 stage1: fix build for i386-linux 2020-04-02 19:07:52 -04:00
Timon Kruiper
b5526d0b3b Fix multiplication overflow in hash_const_val
In some cases the compiler was actually emitting an 64 bit signed
multiplication, instead of a 32 bit unsigned one.
2020-04-02 17:51:04 -04:00
Andrew Kelley
5314641e11 zig cc: support more linker args 2020-04-02 17:29:22 -04:00
Andrew Kelley
c1778bd41f zig cc: support --version-script linker arg
See #4784
2020-04-02 16:59:08 -04:00
Andrew Kelley
c4b3c84b3f zig cc: support -F and -framework 2020-04-02 15:59:48 -04:00
Andrew Kelley
e4edc6d118 zig cc: respect -MF -MV -MD options
Zig disables its caching and forwards these args when any are provided.

see #4784
2020-04-02 15:47:27 -04:00
Andrew Kelley
4848b28ec8 zig cc: detect -mcpu, -march, -mtune
However these are all treated like zig's -mcpu parameter.

See #4784
2020-04-01 18:06:04 -04:00
Rejean Loyer
2b6dfdd3d4 zig cc: add support for -L linker arguments 2020-04-01 17:21:11 -04:00