gracefu
e1959ccd4e
stage2 x86_64: add instruction encoder helper fn
2021-04-16 15:21:16 +08:00
Evan Haas
d4d21dd46d
translate-c: better handling of int -> enum casts
...
In std.meta.cast when casting to an enum type from an integer type, first
do a C-style cast from the source value to the tag type of the enum.
This ensures that we don't get an error due to the source value not being
representable by the enum.
In transCCast() use std.meta.cast instead of directly emitting the cast
operation since the enum's underlying type may not be known at translation
time due to an MSVC bug, see https://github.com/ziglang/zig/issues/8003
Fixes #6011
2021-04-15 22:46:22 -04:00
Andrew Kelley
ccdf55310b
stage2: properly model miscellaneous failed tasks
...
with error messages that go away after updates
2021-04-15 19:01:55 -07:00
Andrew Kelley
2b2920f599
ci: drone: disable stage2 tests
...
See #8545
2021-04-15 16:20:43 -07:00
Andrew Kelley
c795e82cbc
ci: windows: update to llvm 12 msvc tarball
2021-04-15 12:40:22 -07:00
Andrew Kelley
c49fe52cb1
ci: update macos tarball to llvm 12
2021-04-15 11:27:02 -07:00
Andrew Kelley
68e69aae2b
build.zig: omit LLVMTableGen from llvm libs
2021-04-15 10:58:53 -07:00
Andrew Kelley
2a6ec2e155
build.zig: update llvm libs
2021-04-15 10:43:39 -07:00
Andrew Kelley
a38042e3ac
ci: windows: proper flags to zig build
2021-04-15 02:02:36 -07:00
Andrew Kelley
fa633a658f
ci: windows: try the dev kit strategy
2021-04-15 01:44:17 -07:00
Andrew Kelley
4a1d3465cc
ci: windows: ranlib take 2
2021-04-15 01:22:42 -07:00
Andrew Kelley
3266f326de
ci: windows: better -DCMAKE_RANLIB option
2021-04-15 01:14:33 -07:00
Andrew Kelley
04b8354702
freebsd: disable failing test
...
See #8538
2021-04-15 00:59:40 -07:00
Andrew Kelley
996193c228
ci: freebsd: don't try to compile with zig cc
2021-04-15 00:51:26 -07:00
Andrew Kelley
a680c7ba98
ci: windows: use llvm-ar.exe from the tarball
2021-04-15 00:41:30 -07:00
Andrew Kelley
c59241bda0
ci: better handle of -mcpu
2021-04-15 00:18:21 -07:00
Andrew Kelley
553fbeba82
ci: better target triple and mcpu cmake args
2021-04-14 23:49:16 -07:00
Andrew Kelley
85755c51d5
ci: freebsd: set the target triple
2021-04-14 23:35:51 -07:00
Andrew Kelley
df319db058
ci: windows: install git
2021-04-14 23:18:03 -07:00
Andrew Kelley
3967823f3a
ci: freebsd: pass -DZIG_USE_LLVM_CONFIG=OFF
2021-04-14 23:17:08 -07:00
Andrew Kelley
ee42178b43
ci: aarch64-linux: disable run-translated-c tests
...
See #8537
2021-04-14 23:10:51 -07:00
Andrew Kelley
45eb9554c4
ci: windows: try using zig-bootstrap to build zig
2021-04-14 23:03:16 -07:00
Andrew Kelley
406353103a
ci: freebsd: update to llvm 12
2021-04-14 22:59:34 -07:00
Andrew Kelley
1438c324a4
ci: update drone CI to llvm 12
2021-04-14 21:18:23 -07:00
Andrew Kelley
391a40d601
ci: update linux to llvm12 tarball
2021-04-14 20:35:33 -07:00
Michael Dusan
6a7f21d1b8
ci: macos-aarch64 update dep tarballs for llvm12
2021-04-14 19:43:17 -07:00
lithdew
81adcd533e
os/posix: handle ECONNRESET for write/writev
2021-04-14 16:40:06 -07:00
Andrew Kelley
5a3ea9bece
Merge remote-tracking branch 'origin/llvm12'
...
Happy LLVM 12 Release Day.
Please note that the llvm 12 tag does not include the latest commit in
the release/12.x branch, which is in fact a bug fix for a regression
that is causing a failure in Zig's test suite.
Zig master branch is tracking release/12.x, and will be enabling the
test that is fixed by that commit.
2021-04-14 14:41:57 -07:00
Frank Denis
1fada37466
Merge pull request #8518 from akvadrako/doc-field-align
...
Update doc for struct field alignment.
2021-04-14 10:56:37 +02:00
Evan Haas
e761e0ac18
translate-c: wrap switch statements in a while (true) loop
...
This allows `break` statements to be directly translated from the original C.
Add a break statement as the last statement of the while loop to ensure we
don't have an infinite loop if no breaks / returns are hit in the switch.
Fixes #8387
2021-04-13 11:45:03 -07:00
Jakub Konka
36a33c99e3
Merge pull request #8517 from ziglang/zld-archive-fix
...
zld: fix symbol resolution from interdependent static archives
2021-04-13 17:12:26 +02:00
Devin Bayer
ca3aa02206
Update doc for struct field alignment.
2021-04-13 14:53:44 +02:00
Jakub Konka
461543a5fd
zld: fix symbol resolution from interdep archives
...
Fixes symbol resolution if an archive occurring later in the linker
line depends on a object embedded within the archive that occurred
before.
2021-04-13 13:36:08 +02:00
Jakub Konka
65e4725aba
Add standalone test for interdep C archives
...
Tests a scenario where the linker line has the following:
```
main.o libA.a libB.a
```
where `main.o` pulls a symbol from `libB.a`, which in turn is
dependent on a symbol from `libA.a`.
2021-04-13 13:32:59 +02:00
Jakub Konka
a5bbc66f10
zld: cleanup redundant changes
2021-04-13 10:56:03 +02:00
Jakub Konka
db30033de2
zld: rebase to new naming conv for aarch64
2021-04-13 10:56:03 +02:00
Jakub Konka
1119970d22
zld: add x86_64 relocs
2021-04-13 10:56:03 +02:00
Jakub Konka
b1f9db75f3
zld: save locals per TU
2021-04-13 10:56:03 +02:00
Jakub Konka
3b7c9dd6bd
zld: differentiate between static and global in stabs
2021-04-13 10:56:03 +02:00
Jakub Konka
717d382871
zld: streamline tags for Symbol
2021-04-13 10:56:03 +02:00
Jakub Konka
b377e0b370
zld: fix indirect symtab
2021-04-13 10:56:03 +02:00
Jakub Konka
b0a4e1fa46
zld: fix rebase vs bind for GOT entries
2021-04-13 10:56:03 +02:00
Jakub Konka
6e3f82ef28
zld: fix parsing debug info
2021-04-13 10:56:03 +02:00
Jakub Konka
65c27d51f6
zld: limit exports to just main entrypoint
2021-04-13 10:56:03 +02:00
Jakub Konka
421102ba72
zld: move parsing debug info into object
2021-04-13 10:56:03 +02:00
Jakub Konka
dc7cff8ebc
zld: add prelim support for locals
2021-04-13 10:56:03 +02:00
Jakub Konka
23bb6fa9f4
zld: flush MachO
2021-04-13 10:56:03 +02:00
Jakub Konka
db44a7803f
zld: resolve target addresses for relocs
2021-04-13 10:56:03 +02:00
Jakub Konka
b667fe2c62
zld: resolve stubs and GOT entries
2021-04-13 10:56:03 +02:00
Jakub Konka
46cc214f2d
zld: migrate parts of main to new relocs
2021-04-13 10:56:03 +02:00