26895 Commits

Author SHA1 Message Date
Jakub Konka
acd7cbf0b5 elf: init output COMDAT group sections 2023-11-09 17:41:14 +01:00
Jakub Konka
031d9faf02 elf: separate logic for reseting shdr indexes into a separate fn 2023-11-09 15:05:29 +01:00
Jakub Konka
50f48022f0 test/link/elf: fix .eh_frame test 2023-11-09 14:51:00 +01:00
Jakub Konka
1f8dd27e40 elf: correctly format output .eh_frame when emitting relocatable 2023-11-09 14:46:28 +01:00
Jakub Konka
b1fcf0ed8f elf: emit .rela.eh_frame section contents 2023-11-09 12:24:49 +01:00
Jakub Konka
0efc471122 elf: calculate required size for .rela.eh_frame 2023-11-09 12:02:20 +01:00
Jakub Konka
666ac6bf9b elf: track .rela.eh_frame section and emit .eh_frame section symbol 2023-11-09 11:49:32 +01:00
Jakub Konka
f607126614 test/link/elf: verify we can output a valid relocatable with .eh_frame section 2023-11-09 11:49:04 +01:00
Jakub Konka
0de5dd2ef1 elf: misc fixes 2023-11-09 10:32:39 +01:00
Jakub Konka
0299ed5036 elf: fix 32bit build 2023-11-08 18:45:43 +01:00
Jakub Konka
9bcb432a0e elf: test emitting relocatable 2023-11-08 18:41:09 +01:00
Jakub Konka
29d7727254 elf: emit SHN_COMMON symbols in -r mode 2023-11-08 18:15:41 +01:00
Jakub Konka
0b4d398c40 elf: streamline codepaths for different linker modes (object, ar, exe/dyn) 2023-11-08 17:35:56 +01:00
Jakub Konka
a16e6706b3 elf: LLVM emits relocs to undef local symbols - color me surprised! 2023-11-08 15:10:28 +01:00
Jakub Konka
d8b1ef9430 elf: adjust r_addend with offset of the original input section ref'd via STT_SECTION 2023-11-08 12:11:55 +01:00
Jakub Konka
ae08f9bfe9 elf: claim unresolved dangling symbols as undef externs in -r mode 2023-11-08 11:51:11 +01:00
Jakub Konka
e87c751558 elf: reference .rela sections via output section index 2023-11-08 10:57:34 +01:00
Jakub Konka
5e78600f0f elf: actually track output symtab index of symbols 2023-11-07 23:18:41 +01:00
Jakub Konka
ecf6ed7d9b elf: allocate alloc sections when emitting relocatable 2023-11-07 15:04:57 +01:00
Jakub Konka
31b280c78f elf: emit .rela.eh_frame section header if required 2023-11-07 14:47:11 +01:00
Jakub Konka
0211d6bf4f elf: create link between .rela and output section 2023-11-07 14:42:27 +01:00
Jakub Konka
e22b3595c1 elf: update .rela section sizes 2023-11-07 14:29:44 +01:00
Jakub Konka
c7ed7c4690 elf: generate section symbols when writing symtab 2023-11-07 13:31:31 +01:00
Jakub Konka
3df53d1722 elf: create skeleton of required changes for supporting -r mode 2023-11-07 11:19:55 +01:00
Matthew Lugg
b3462b7cec
Merge pull request #17692 from kcbanner/struct_field_init_pass
sema: analyze struct field bodies in a second pass, to allow them to use the layout of the struct itself
2023-11-07 07:44:32 +00:00
mlugg
d78eda34c5 Sema: emit @intCast safety check correctly for vectors
This code was previously tripping an assertion by not making this value
used in the safety check a vector.
2023-11-07 06:42:15 +00:00
mlugg
9b394a200a Sema: allow destructuring vectors
This was intended to work when destructuring was first implemented, and
was just unintentionally missed out.
2023-11-07 06:11:01 +00:00
Jakub Konka
bf0387b6bb
Merge pull request #17873 from ziglang/elf-archive
elf: implement archiving input object files
2023-11-07 03:22:14 +01:00
kcbanner
1acb6a53d0
wasm: support rendering unions using their backing type if they have no defined tag type 2023-11-07 00:49:39 +00:00
kcbanner
35c86984a6
cbe: support rendering union values that have no defined tag type
This was regressed in d657b6c0e2ab7c47f5416dc4df1abb2bfbecd4b6, when
the comptime memory model for unions was changed to allow them to have
no defined tag type.
2023-11-07 00:49:39 +00:00
kcbanner
f10499be0a
sema: analyze field init bodies in a second pass
This change allows struct field inits to use layout information
of their own struct without causing a circular dependency.

`semaStructFields` caches the ranges of the init bodies in the `StructType`
trailing data. The init bodies are then resolved by `resolveStructFieldInits`,
which is called before the inits are actually required.

Within the init bodies, the struct decl's instruction is repurposed to refer
to the field type itself. This is to allow us to easily rebuild the inst_map
mapping required for the init body instructions to refer to the field type.

Thanks to @mlugg for the guidance on this one!
2023-11-07 00:49:35 +00:00
Andrew Kelley
234693bcbb tests: skip native CPU std tests on Windows
See tracking issue #17902
2023-11-06 16:03:04 -07:00
XXIV
5ea973dc39 langref: fix malloc return type 2023-11-06 23:46:17 +02:00
Jakub Konka
261db02018 CheckObject: support parsing and dumping archive symtab for ELF 2023-11-06 21:18:26 +01:00
Jacob Young
9ced27dace x86_64: fix passing register-sized payload as non-reigster-sized union
Closes #17885
2023-11-06 14:11:31 -05:00
Bogdan Romanyuk
62e67a2b56
Sema: emit error when pointer to extern function is called 2023-11-06 15:26:28 +00:00
Jakub Konka
6490e2ed82 test/link/elf: improve test linking with static lib 2023-11-06 14:47:01 +01:00
Jakub Konka
1b69b0c621 elf: clearly separate updating and writing symtab from only ZigObject 2023-11-06 14:26:35 +01:00
Jakub Konka
281dabaa88 Compilation: unconditionally close open file handles for writable dance 2023-11-06 13:47:39 +01:00
Andrew Kelley
e74ced21b7 frontend: fix -fsingle-threaded default detection logic
The logic in 509be7cf1f10c5d329d2b0524f2af6bfcabd52de assumed that
`use_llvm` meant that the LLVM backend would be used, however, use_llvm
is false when there are no zig files to compile, which is the case for
zig cc. This logic resulted in `-fsingle-threaded` which made libc++
fail to compile for C++ code that includes the threading abstractions
(such as LLVM).
2023-11-06 01:16:09 -05:00
Andrew Kelley
1b0b46a8a9
Merge pull request #17871 from jacobly0/x86_64
x86_64: get a compiler compiled with the x86_64 backend passing x86_64 backend tests
2023-11-05 18:45:21 -05:00
Andrew Kelley
702b809ea3
Merge pull request #17815 from Luukdegram/wasm-no-entry
wasm-linker: implement `-fno-entry` and correctly pass `--shared` and `--pie` when given
2023-11-05 18:44:12 -05:00
Igor Anić
bec36aa7c0 io_uring: add multishot accept operation
Server networking application typically accept multiple connections. Multishot
accept simplifies handling these situations. Applications submits once and
receives CQE whenever a new connection request comes in.

Multishot is active until it is canceled or experience error. While active, and
further notification are expected CQE completion will have IORING_CQE_F_MORE set
in the flags. If this flag isn't set, the application must re-arm this request
by submitting a new one.

Reference: [io_uring and networking in 2023](https://github.com/axboe/liburing/wiki/io_uring-and-networking-in-2023#multi-shot)
2023-11-06 00:12:39 +02:00
Jacob Young
0ea7189c23 behavior: enable test passing with x86_64 backend 2023-11-05 11:54:29 -05:00
Jacob Young
c2cda947c9 src: fix memory leaks 2023-11-05 11:54:29 -05:00
Jacob Young
7b9f8782c8 build: add option to specify whether to use the llvm backend 2023-11-05 09:30:28 -05:00
Jakub Konka
205f8214d8 test/link/elf: enable our ELF archiver 2023-11-05 13:42:26 +01:00
Jakub Konka
8142925c7e elf: hook up saving object files in an archive 2023-11-05 13:37:13 +01:00
Jakub Konka
55fa8a04f1 elf: add hooks for archiving Objects 2023-11-05 12:56:17 +01:00
Jakub Konka
5c48236103 elf: init objects after parsing them 2023-11-05 12:37:15 +01:00