kcbanner
53500a5768
sema: fixup underflows during struct / ptr array init when using -fstrip
2023-11-12 18:22:57 -05:00
Andrew Kelley
70d8baaec1
Revert "Sema: fix comparison with undefined"
...
This reverts commit 547481c31c8a538a7badbdce66d81820177ce87f.
There is a comment that did not get addressed with this patch, and the
required test cases are not added.
Reopens #17798 .
2023-11-12 14:33:17 -07:00
Bogdan Romanyuk
547481c31c
Sema: fix comparison with undefined
2023-11-12 11:03:23 +02:00
kcbanner
3fc6a2f113
sema: pass sema through if available for the array_type case in bitSizeAdvanced
2023-11-11 13:11:51 +00:00
Jacob Young
89cac88e91
behavior: add testing for LLVM SROA bugs
2023-11-10 18:04:09 -05:00
Jakub Konka
9ad03b628f
Merge pull request #17955 from ziglang/issue-17951
...
macho: handle special section/segment boundary symbols
2023-11-10 18:36:06 +01:00
Bogdan Romanyuk
ec934c6d32
disallow calling @trap at comptime
2023-11-10 18:39:42 +02:00
Jakub Konka
17177727c0
test/link: refactor common bits between ELF and MachO tests
2023-11-10 13:50:33 +01:00
Jakub Konka
7566a8fbd8
test/link: spawn ELF and MachO tests from the same root test/link/link.zig
2023-11-10 13:44:43 +01:00
Jakub Konka
c550eb3e8a
Merge pull request #17933 from ziglang/elf-r-mode
...
elf: the dreaded `-r` mode
2023-11-10 07:57:52 +01:00
mlugg
3f10b3ee1e
Sema: do not allow comptime-only pointer fields in packed structs
2023-11-10 06:51:48 +00:00
Jakub Konka
73fd4ed54b
test/link/elf: make .eh_frame relocatable test also verify COMDATs we emit
2023-11-09 23:22:47 +01:00
Jakub Konka
50f48022f0
test/link/elf: fix .eh_frame test
2023-11-09 14:51:00 +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
mlugg
997eaf6d87
Sema: do not force resolution of struct field inits when calling function pointer field
...
b3462b7 caused a regression in a third-party project, since it forced
resolution of field initializers for any field call 'foo.bar()', despite
this only being necessary when 'bar' is a comptime field.
See https://github.com/ziglang/zig/pull/17692#issuecomment-1802096734 .
2023-11-08 23:47:10 -07:00
Jakub Konka
9bcb432a0e
elf: test emitting relocatable
2023-11-08 18:41:09 +01:00
mlugg
4504e03a18
Sema: fix source location for untyped array init with result type
...
Resolves : #17923
2023-11-08 06:56:52 +00:00
dweiller
81219586bc
sema: allow slicing [*]T without end
2023-11-07 17:01:32 +02: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
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
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
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
Jacob Young
0ea7189c23
behavior: enable test passing with x86_64 backend
2023-11-05 11:54:29 -05:00
Jakub Konka
205f8214d8
test/link/elf: enable our ELF archiver
2023-11-05 13:42:26 +01:00
Bogdan Romanyuk
e9a6197a8e
Sema: fix error notes with wrong extern type
2023-11-05 12:36:06 +02:00
Jakub Konka
f24ceec35a
Merge pull request #17844 from ziglang/elf-object
...
elf: handle emitting relocatables and static libraries - humble beginnings
2023-11-04 20:58:15 +01:00
Jakub Konka
ee66137269
elf: add link smoke tests covering emitting obj and static lib
2023-11-04 09:13:34 +01:00
Jakub Konka
b8c8565e93
elf: implement --gc-sections for non-LLVM Zig source
2023-11-04 09:08:27 +01:00
Jacob Young
509be7cf1f
x86_64: fix std test failures
2023-11-03 23:18:21 -04:00
Luuk de Gram
c893f83715
cli: consolidate entry point flags
2023-11-03 12:48:53 +01:00
Luuk de Gram
938f9dea37
update linker tests
...
This updates all linker tests to include `no_entry` as well as changes
all tests to executable so they do not need to be updated later when
the in-house WebAssembly linker supports dynamic libraries.
2023-11-03 12:48:53 +01:00
Luuk de Gram
db1825e931
wasm: re-enable regressed tests
2023-11-01 19:47:15 +01:00
Andrew Kelley
3fc6fc6812
std.builtin.Endian: make the tags lower case
...
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
Jacob Young
d890e81761
mem: fix ub in writeInt
...
Use inline to vastly simplify the exposed API. This allows a
comptime-known endian parameter to be propogated, making extra functions
for a specific endianness completely unnecessary.
2023-10-31 21:37:35 -04:00
Jacob Young
50cdb65784
Sema: fix incorrect error comptime-mutating empty array
2023-10-31 21:37:35 -04:00
kcbanner
825da34769
Add compile error test case for union layout depending on pointer alignment
2023-10-31 01:35:58 +00:00
kcbanner
fb523c6283
sema: when guessing union alignment, save the result and check if the guess was correct
2023-10-31 01:35:58 +00:00
Jakub Konka
10d03acdb5
Merge pull request #17773 from ziglang/elf-exports
...
link: implement exporting anon decls
2023-10-30 17:29:05 +01:00
DilithiumNitrate
91e117697a
Fix hasRuntimeBitsAdvanced lazy case for pointers and optionals
...
As suggested by mlugg, always returns `error.NeedLazy`. If this has a
performance impact, it could be replaced by adding lazy handling to
`comptimeOnlyAdvanced`.
2023-10-29 21:12:43 +00:00
Jakub Konka
71dfea1f17
coff: implement exporting anon decls
2023-10-29 18:55:58 +01:00
Jakub Konka
a7a95ce9c4
macho: implement exporting anon decls
2023-10-29 18:55:58 +01:00
Jakub Konka
eaca72534c
elf: implement exporting anon decls
2023-10-29 18:55:58 +01:00