26460 Commits

Author SHA1 Message Date
Jakub Konka
eb5276c94e
Merge pull request #17556 from ziglang/elf-link-zig-proper
elf: port 99% of zld ELF linker to Zig proper
2023-10-17 17:36:40 +02:00
Jakub Konka
742a130ce5 elf: fix use-after-move 2023-10-17 17:35:16 +02:00
Andrew Kelley
5039a5db83
Merge pull request #17558 from xxxbxxx/glibc-strtoul
build compatibility for c++ & linux
2023-10-17 11:09:53 -04:00
Jacob Young
cfa247e53b x86_64: fix C abi argument passing in memory 2023-10-17 10:41:48 -04:00
Andrew Kelley
877393d17a std.fs: fix relative symbolic links on Windows
closes #17564
2023-10-17 06:27:07 -04:00
Jakub Konka
666e9df170 elf: ensure we build with -fPIE when testing init array order 2023-10-17 11:30:56 +02:00
Andrew Kelley
0b8fca5a19 CI: bump aarch64-linux-debug timeout to 8 hours
When the system gets busy, the runs take drastically longer.
2023-10-16 21:55:11 -07:00
Ali Chraghi
e44152e252 spirv: fieldParentPtr 2023-10-16 20:27:28 -04:00
Andrew Kelley
1456f95b3c std: disable flaky test on aarch64-windows
tracked by #17134
2023-10-16 16:13:46 -07:00
Jakub Konka
43fb74f81a elf: do not open file if emitting object file for LLVM and elf linker
This is at least until we implement `-r` option in the linker.
2023-10-16 23:57:33 +02:00
Xavier Bouchoux
69d6f2e1b8 build.zig: add support for using "zig c++" as the bootstrap c++ compiler
The build was previously failing with `error: unknown command: -print-file-name=libstdc++.a`
because the command invocation was
`zig -print-file-name=libstdc++.a`
instead of
`zig c++ -print-file-name=libstdc++.a`

note: .cxx_compiler_arg1 = "" instead of undefined to avoid breaking existing setups without requiring to run cmake again.
2023-10-16 23:07:04 +02:00
Xavier Bouchoux
0afead5651 glibc patch: add backwards compatibility for strtol-family functions
following suit from b40943e253c079ec3de1b149dd2ef0ccc3da38a4,
add a version guard in addition to the ISOC2X check.
2023-10-16 22:43:28 +02:00
Jakub Konka
77443ac2b5 elf: skip tests on foreign architectures 2023-10-16 21:45:28 +02:00
Jakub Konka
78f2ae7f29
Merge pull request #17531 from moosichu/fix/frameworks
Fix some frameworks not linking macos
2023-10-16 20:45:04 +02:00
Jakub Konka
d2727b808c elf: fix 32bit build 2023-10-16 19:56:47 +02:00
Jakub Konka
e89155b565 elf: refactor logs 2023-10-16 19:33:06 +02:00
Jakub Konka
ee1c3c7058 elf: correctly copy and write out debug sections 2023-10-16 19:33:06 +02:00
Jakub Konka
b0e2c6323b elf: sort PT_LOAD by address in PHDR table
Turns out order matters as otherwise we face unexplainable
segfaults to do with improper page mapping in static environments
(dynamic environments seem unaffected).
2023-10-16 19:33:06 +02:00
Jakub Konka
6993b3e23e codegen: refactor .actual_got into .extern_got 2023-10-16 19:33:06 +02:00
Jakub Konka
d3b1c903dd elf: emit empty TLS phdr when linking against musl libc even if unneeded 2023-10-16 19:33:06 +02:00
Jakub Konka
5192a2fbbe elf: do not allocate zerofill segment in file offsets 2023-10-16 19:33:06 +02:00
Jakub Konka
17b8e8ab29 elf: sort the entire shdr table the usual way 2023-10-16 19:33:06 +02:00
Jakub Konka
46cf4c5d93 elf: sort phdr table 2023-10-16 19:33:06 +02:00
Jakub Konka
5423778f6f elf: add self-hosted tests 2023-10-16 19:33:06 +02:00
Jakub Konka
7b2cbcf0fe codegen+elf: check if extern is a variable ref 2023-10-16 19:33:06 +02:00
Jakub Konka
45197ea7ad codegen+elf: lower imported data refs 2023-10-16 19:33:06 +02:00
Jakub Konka
c71a79f618 elf: make .zig.rodata writeable 2023-10-16 19:33:06 +02:00
Jakub Konka
17635e4f2a x86_64: add -fPIC support targeting ELF 2023-10-16 19:33:06 +02:00
Jakub Konka
b3d98a4b88 elf: emit dynamic base relocs for .zig.got entries when required 2023-10-16 19:33:06 +02:00
Jakub Konka
315cd7623e elf: fix section sorting logic 2023-10-16 19:33:05 +02:00
Jakub Konka
5fad683791 elf: emit (broken) debug sections 2023-10-16 19:33:05 +02:00
Jakub Konka
85d451f96c elf: re-enable self-hosted backends 2023-10-16 19:33:05 +02:00
Jakub Konka
7be983ac92 elf: create new synthetic section ZigGotSection 2023-10-16 19:33:05 +02:00
Jakub Konka
9b6337ab06 elf: exclude Zig special sections from bulk alloc 2023-10-16 19:33:05 +02:00
Jakub Konka
9da6574f7b elf: refactor 2023-10-16 19:33:05 +02:00
Jakub Konka
716a45a209 elf: use findFreeSpace mechanics to allocate object-extracted segments 2023-10-16 19:33:05 +02:00
Jakub Konka
5ff12003ee elf: dynamically allocate SHDR table 2023-10-16 19:33:05 +02:00
Jakub Konka
1939c7d182 elf: clean up logic for allocating TLS segment 2023-10-16 19:33:05 +02:00
Jakub Konka
c87e73b19f elf: allocate non-alloc sections using incremental mechanism 2023-10-16 19:33:05 +02:00
Jakub Konka
2aa6099ad9 elf: assume only one TLS segment for now 2023-10-16 19:33:05 +02:00
Jakub Konka
8be71906d9 elf: split allocating sections/segments into alloc and non-alloc 2023-10-16 19:33:05 +02:00
Jakub Konka
bcce035636 elf: bring back PT_LOAD for PT_PHDR for incremental codepath 2023-10-16 19:33:05 +02:00
Jakub Konka
43397bbdc4 elf: always write SHDR table, at least for now 2023-10-16 19:33:05 +02:00
Jakub Konka
6a7a20520d elf: always write PHDR table, at least for now 2023-10-16 19:33:05 +02:00
Jakub Konka
5148e38751 elf: create and allocate special PHDRs out of the loop 2023-10-16 19:33:05 +02:00
Jakub Konka
59fcf16732 elf: move creation of PT_PHDR out of initPhdrs and initMetadata 2023-10-16 19:33:05 +02:00
Jakub Konka
e571208433 elf: rename Zig-specific section handles to _zig_ infixed 2023-10-16 19:33:05 +02:00
Jakub Konka
871591ca1c elf: fix conflicts after rebase gone bad 2023-10-16 19:33:05 +02:00
Jakub Konka
b3f40c35dc elf: fix testTlsOffsetAlignment test 2023-10-16 19:33:05 +02:00
Jakub Konka
67a02bee2c elf: port more linker tests 2023-10-16 19:33:05 +02:00