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
Jakub Konka
6a866f1a96
zld: preprocess relocs on arm64
2021-04-13 10:56:03 +02:00
Jakub Konka
4e676ecbb5
zld: allocate addresses for global symbols
2021-04-13 10:56:03 +02:00
Jakub Konka
d5c2f8ed32
zld: store a single global symtab
2021-04-13 10:56:03 +02:00
Jakub Konka
1b5bceec91
zld: start work on reloc preprocessing
2021-04-13 10:56:03 +02:00
Jakub Konka
04659f5b82
zld: allocate segments based on worst-case and upper-limit
2021-04-13 10:56:03 +02:00
Jakub Konka
116ea1bf2c
zld: assume remaining undefs are from libSystem
2021-04-13 10:56:03 +02:00
Jakub Konka
b0105029ca
zld: refactor object and archive parsing
2021-04-13 10:56:03 +02:00
Jakub Konka
988b184d03
zld: redo symbol resolution in objects
...
Store only globals and undefs at the linker level, while all locals
stay scoped to the actual object file they were defined in. This is
fine since the relocations referencing locals will always be resolved
first using the local symbol table before checking for the reference
within the linker's global symbol table.
This also paves the way for proper symbol resolution from within static
and dynamic libraries.
2021-04-13 10:56:03 +02:00
Andrew Kelley
262e09c482
stage1: resolve builtin types and values via std.builtin
...
rather than via `@import("builtin")`. This helps avoid the need for
`usingnamespace` used in builtin.zig or in std.builtin.
2021-04-12 15:54:28 -07:00
Michael Dusan
cc186dac65
test-stack-traces: enable elf/dwarf platforms
2021-04-12 17:18:56 -04:00
Michael Dusan
28ae498254
dwarf: fix LineNumberProgram check
...
- on first iteration populate `prev_` fields and do nothing else
closes #8421
2021-04-12 17:18:56 -04:00
Andrew Kelley
c4c7cb252a
Merge pull request #8502 from xackus/std-docs
...
std docs: @This() in generic types
2021-04-12 11:37:00 -07:00
Jakub Konka
d6d27d51ef
CI: update brew before installing pkgs
2021-04-12 18:42:51 +02:00
Michael Dusan
0fa1a2cb73
Revert "dwarf: fix LineNumberProgram check"
...
- needed/needs to go through review process
This reverts commit 746f65f8b3ce11d67d8fd392aea8bc05a24adae6.
2021-04-12 06:55:12 -04:00
Michael Dusan
746f65f8b3
dwarf: fix LineNumberProgram check
...
- tolerate out-of-order DW_AT_ranges
closes #8421
2021-04-12 06:12:00 -04:00
xackus
ab991cab84
std docs: @This() in generic types
2021-04-12 09:31:45 +02:00
Andrew Kelley
d2d4df4074
Merge pull request #8477 from joachimschmidt557/stage2-arm
...
stage2 codegen: Set MCValue of register arguments to their stack copies
2021-04-11 19:00:25 -07:00
Andrew Kelley
c5e662d860
Merge pull request #8497 from LemonBoy/some-ppc-fixes
...
Improve Improve PowerPC support
2021-04-11 18:59:31 -07:00
Michael Dusan
93cf9560b1
Merge remote-tracking branch 'origin/master' into llvm12
2021-04-11 17:40:19 -04:00
xackus
7857ad78db
std docs: update var to anytype
2021-04-11 22:59:30 +02:00
LemonBoy
44f8ce690d
std: Fix typo in sqrt implementation
...
The code initializes twice `t` instead of `t1`, leaving the latter
uninitialized. The problem manifested itself by corrupting the LSBs of
the result in unpredictable ways.
2021-04-11 21:27:39 +02:00
LemonBoy
8d94dc625b
compiler-rt: Introduce PowerPC-specific f128 helpers
...
For historical reasons IEEE f128 ops use `kf` instead of `tf` in their
names, there's no functional change.
2021-04-11 21:26:22 +02:00
LemonBoy
9bebdc77d6
std: Fix TLS definitions for 32bit PowerPC targets
...
Correct some silly errors and add the missing piece to set the thread
pointer (r2).
2021-04-11 21:26:22 +02:00
Andrew Kelley
82a31aac9b
Merge pull request #8483 from fengb/powerpc
...
Improve PowerPC support
2021-04-11 10:12:02 -07:00