LemonBoy
ebf97627fd
build: Test the c.zig file too
...
* Add some more tests for the sqrt/sqrtf implementations.
The idea is to cross-check the software impl with the HW one whenever
possible.
* Fix a broken test, oops.
2021-04-14 17:53:26 +02: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
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
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
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
LemonBoy
d97981f6fd
std: Make a test-case independent of the target endianness
2021-04-11 18:38:04 +02:00
Michael Dusan
cab1d5c1a3
azure: OnMasterSuccess dependsOn BuildMacOS_arm64
2021-04-11 05:17:18 -04:00
joachimschmidt557
4fe575f47b
stage2 ARM: Add fibonacci test
2021-04-11 10:19:36 +02:00
joachimschmidt557
a6ddc12b33
stage2 codegen: Set MCValue of register arguments to their stack copy
2021-04-11 10:19:35 +02:00
Michael Dusan
c676c21824
ci: remove superfluous linefeed from macos arm64
2021-04-11 01:33:17 -04:00
Benjamin Feng
073d8e55c3
Initialize the ppc stack frame correctly
2021-04-10 22:47:22 -05:00
Benjamin Feng
2e85eb2bf8
Rename time32 syscalls to match rest of stdlib
2021-04-10 22:47:22 -05:00
Benjamin Feng
ae3a0ff2d1
_start assembly for ppc
2021-04-10 22:47:22 -05:00