Commit graph

17331 commits

Author SHA1 Message Date
Matthew Lugg
cbfa87cbea
Merge pull request #25889 from mlugg/incremental-llvm-warn
compiler: warn when using -fincremental with LLVM backend
2025-11-10 21:10:31 +00:00
Alex Rønne Petersen
d182c7e3bc
Merge pull request #25886 from alexrp/kvx
beginnings of KVX target support (via CBE)
2025-11-10 16:38:23 +01:00
xdBronch
fb914a9a10 sema: print @panic message at comptime 2025-11-10 14:21:26 +00:00
Matthew Lugg
13993c4f62
compiler: warn when using -fincremental with LLVM backend
This configuration hasn't had much work put into it yet, so is all but
guaranteed to miscompile or crash. Since users are starting to try out
`-fincremental`, and LLVM is still the default backend in many cases,
it's worth having this warning to avoid bug reports like
https://github.com/ziglang/zig/issues/25873.
2025-11-10 12:56:35 +00:00
Matthew Lugg
6d280dc1b0
compiler: update logFn to use color
To match the new default implementation. In fact, I implemented this by
simply dispatching *to* the default implementation after the debug log
guard; no need to complicate things!
2025-11-10 12:55:39 +00:00
Alex Rønne Petersen
cde865e06a
llvm: set sub-arch for spirv 1.6 2025-11-10 12:54:04 +01:00
Alex Rønne Petersen
4ff6e290dd
cbe: kvx uses $-prefixed registers 2025-11-10 09:40:44 +01:00
Alex Rønne Petersen
1e2c216156
compiler: kvx requires 8-byte aligned functions 2025-11-10 08:20:24 +01:00
Alex Rønne Petersen
2c470d24b3
std.Target: add Arch tag and info for kvx 2025-11-10 08:20:21 +01:00
Jacob Young
f3309a96a7
Merge pull request #25819 from jacobly0/elfv2-emit-obj 2025-11-10 00:10:17 -05:00
Mateusz Poliwczak
bdbfc7de3f std.zig.Zir: remove ref_start_index from enum fields of Index and OptionalIndex
This change removes the ref_start_index from the possible enum values of
Index and OptionalIndex. It is not really a index, but a constant that
tells the offset of static Refs, so lets move it where such constant
belongs i.e. to the Ref.
2025-11-09 10:45:14 +00:00
Jacob Young
d33c00cad0 MappedFile: avoid allocating file space with inconsistent state 2025-11-09 03:31:26 -05:00
Jacob Young
02a241f472 Elf2: incrementally update object relocs 2025-11-09 03:31:26 -05:00
Jacob Young
b1d46339b5 Elf2: implement object relocs 2025-11-09 03:31:26 -05:00
Jacob Young
80c961159b Elf2: elide unused nodes when emitting objects 2025-11-09 03:31:26 -05:00
Jacob Young
7bcefe5a22 Elf2: emit object files that are slightly more object-like 2025-11-09 03:31:26 -05:00
Ryan Liptak
be4eaed7c4
Merge pull request #25860 from squeek502/coalesce-to-std-zig
Move/coalesce `CompressDebugSections` and `RcIncludes` enums to `std.zig`
2025-11-08 02:34:44 -08:00
Carl Åstholm
43eb9b52cc link.Elf: Ensure archive header fields are not left blank
ld.lld fails with "truncated or malformed archive" errors when reading
archive header field values that are not valid numbers.
2025-11-08 02:11:52 -08:00
Ryan Liptak
da77d306b6 Move/coalesce RcIncludes enum to std.zig.RcIncludes 2025-11-07 19:16:52 -08:00
Ryan Liptak
f587209e04 Move/coalesce CompressDebugSections enum to std.zig.CompressDebugSections 2025-11-07 19:15:55 -08:00
Ryan Liptak
74d2536715
Merge pull request #25158 from castholm/subsystem
Misc. Windows subsystem refactorings
2025-11-07 18:56:52 -08:00
xdBronch
92f64899c1 sema: disallow slices of opaque types 2025-11-07 12:12:32 +00:00
David Rubin
483f9bd367
llvm: add extra clobbers to valgrind requests
This seems to work around a very puzzling miscompilation first
present in LLVM 21.x. We already unconditionally add these
clobbers to inline assembly that came from the source, the
valgrind requests should also contain them.
2025-11-06 20:27:38 -08:00
David Rubin
09e4035e79
llvm: clobber rdx instead of edx for x86-64 valgrind request 2025-11-06 20:12:35 -08:00
Jacob Young
a6d444c271 x86_64: implement split vector stores
Closes #25809
2025-11-04 22:45:54 -05:00
Carl Åstholm
54f2a7c833 Move std.Target.SubSystem to std.zig.Subsystem
Also updates the field names to conform with the rest of std.
2025-11-05 01:31:26 +01:00
Jacob Young
459f3b7ede codegen: fix tuple padding
Closes #25797
2025-11-04 06:04:30 -05:00
kbz_8
c603d27f90
Fixing SPIR-V header generator magic + Adding Zig compiler version to SPIR-V OpSource (#25435)
* fixing Zig generator magic in SPIR-V header; adding zig compiler version to SPIR-V OpSource

* Update src/codegen/spirv/Module.zig

Co-authored-by: rpkak <67059904+rpkak@users.noreply.github.com>

---------

Co-authored-by: rpkak <67059904+rpkak@users.noreply.github.com>
2025-11-04 04:40:29 +00:00
Bingwu Zhang
a8fea09cd5 cbe: fix more MIPS register names in inline assembly 2025-11-01 15:11:35 +01:00
Jacob Young
5b060ef9d4
Merge pull request #25558 from jacobly0/elfv2-load-obj
Elf2: start implementing input object loading
2025-10-30 12:09:13 -04:00
Jacob Young
32779a7c73
aarch64: fix macho external references 2025-10-30 09:31:30 +00:00
Jacob Young
402c14f86a
aarch64: implement optional comparisons 2025-10-30 09:31:30 +00:00
Matthew Lugg
74931fe25c
std.debug.lockStderrWriter: also return ttyconf
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving
syscalls), and doing it every time we need to print isn't really
necessary; under normal usage, we can compute the value once and cache
it for the whole program's execution. Since anyone outputting to stderr
may reasonably want this information (in fact they are very likely to),
it makes sense to cache it and return it from `lockStderrWriter`. Call
sites who do not need it will experience no significant overhead, and
can just ignore the TTY config with a `const w, _` destructure.
2025-10-30 09:31:28 +00:00
Jacob Young
09aa4add2a x86_64: add lret encoding
Closes #25608
2025-10-29 19:31:44 -04:00
Jacob Young
52a029e503 x86_64: continue hacking around unimplemented linker logic
Closes #25666
2025-10-29 19:31:44 -04:00
Jacob Young
ada9035af5 x86_64: fix encoding for out with an immediate port
Closes #25547
2025-10-29 18:41:31 -04:00
Jacob Young
6e8b07ca15 Elf: fix alignment of merge subsections
Closes #25565
2025-10-29 18:41:05 -04:00
Jacob Young
0834e696f7 Elf2: start implementing dynamic linking 2025-10-29 18:15:09 -04:00
Jacob Young
40901440a6 Elf2: simplify archive loading 2025-10-29 18:14:16 -04:00
Jacob Young
c4478e078b Elf2: load archives 2025-10-29 18:07:12 -04:00
Jacob Young
7542c3260f Elf2: load relocations from input objects 2025-10-29 18:06:17 -04:00
Jacob Young
6f0476e41d Elf2: start implementing input object loading 2025-10-29 18:05:49 -04:00
Andrew Kelley
a072d821be
Merge pull request #25592 from ziglang/init-std.Io
std: Introduce `Io` Interface
2025-10-29 13:51:37 -07:00
Alex Rønne Petersen
a7119d4269 remove all IBM AIX and z/OS support
As with Solaris (dba1bf9353), we have no way to
actually audit contributions for these OSs. IBM also makes it even harder than
Oracle to actually obtain these OSs.

closes #23695
closes #23694
closes #3655
closes #23693
2025-10-29 14:25:51 +01:00
Andrew Kelley
df4c30ca16 link: move the windows kernel bug workaround to Io implementation 2025-10-29 06:20:51 -07:00
Andrew Kelley
02119362d7 wasm linking: handle unreachable call_indirect
The compiler crashed when we tried to call a function pointer for which
the type signature does not match any function body or function import
in the entire wasm executable, because there is no way to create a
reference to a function without it being in the function table or import
table. Solution is to make this instruction lower to unreachable.
2025-10-29 06:20:51 -07:00
Andrew Kelley
97bde94e36 compiler: upgrade unit tests to new API 2025-10-29 06:20:50 -07:00
Andrew Kelley
90fdd21df6 std: move DNS record enum to a better namespace 2025-10-29 06:20:50 -07:00
Andrew Kelley
2bcdde2985 compiler: update for introduction of std.Io
only thing remaining is using libc dns resolution when linking libc
2025-10-29 06:20:49 -07:00
Andrew Kelley
79a59c5165 coff linker: don't check the time
compiler toolchains have no business knowing what time it is
2025-10-29 06:20:49 -07:00