17268 Commits

Author SHA1 Message Date
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
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 (dba1bf935390ddb0184a4dc72245454de6c06fd2), 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
Andrew Kelley
d40803284e progress towards compiler building again 2025-10-29 06:20:49 -07:00
Andrew Kelley
066864a0bf std.zig.system: upgrade to std.Io.Reader 2025-10-29 06:20:48 -07:00
Alex Rønne Petersen
b409cdf63f
Elf2: set ELFOSABI_OPENBSD for openbsd 2025-10-29 07:48:42 +01:00
Alex Rønne Petersen
49b5b4b249
Elf2: set ELFOSABI_FREEBSD for ps4 2025-10-29 07:48:29 +01:00
Matthew Lugg
8907dc8a4f Zcu: use shortest reference trace
The logic for computing reference traces was unintentionally finding the
*longest* possible trace (approximately). I think I already tried to fix
this before, but misunderstood how my own code works. Here, we fix it
properly: by slightly reworking the logic to use one ArrayHashMap for
both the result and the traversal queue, we trivially get a proper
breadth-first traversal so that we can find the shortest possible
reference trace for every referenced unit.
2025-10-29 05:34:19 +00:00
Cooksey99
2cbd0d3f08 spirv: fix airWorkGroupSize to use workgroup_size builtin 2025-10-28 10:23:32 +01:00
Alex Rønne Petersen
06d9e3bc06
Merge pull request #25691 from GasInfinity-Forks/x86_16-gcc
feat: init x86_16 arch via CBE
2025-10-28 10:19:21 +01:00
Alex Rønne Petersen
dba1bf9353 remove all Oracle Solaris support
There is no straightforward way for the Zig team to access the Solaris system
headers; to do this, one has to create an Oracle account, accept their EULA to
download the installer ISO, and finally install it on a machine or VM. We do not
have to jump through hoops like this for any other OS that we support, and no
one on the team has expressed willingness to do it.

As a result, we cannot audit any Solaris contributions to std.c or other
similarly sensitive parts of the standard library. The best we would be able to
do is assume that Solaris and illumos are 100% compatible with no way to verify
that assumption. But at that point, the solaris and illumos OS tags would be
functionally identical anyway.

For Solaris especially, any contributions that involve APIs introduced after the
OS was made closed-source would also be inherently more risky than equivalent
contributions for other proprietary OSs due to the case of Google LLC v. Oracle
America, Inc., wherein Oracle clearly demonstrated its willingness to pursue
legal action against entities that merely copy API declarations.

Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in
maintenance mode since, presumably to be retired completely sometime in the 2030s.

For these reasons, this commit removes all Oracle Solaris support.

Anyone who still wishes to use Zig on Solaris can try their luck by simply using
illumos instead of solaris in target triples - chances are it'll work. But there
will be no effort from the Zig team to support this use case; we recommend that
people move to illumos instead.
2025-10-27 07:35:38 -07:00
GasInfinity
104c272ae5
feat: init x86_16 arch via CBE 2025-10-27 11:19:51 +01:00
Alex Rønne Petersen
67c9d57e27
Compilation: define __illumos__ for C/C++ when targeting illumos
Per the illumos GCC fork.
2025-10-26 09:51:35 +01:00
Alex Rønne Petersen
433846100b
Merge pull request #25700 from alexrp/solaris-illumos-stuff
Some Solaris/illumos fixes
2025-10-26 00:59:33 +02:00
Alex Rønne Petersen
e39b82bf4e
compiler: avoid using self-hosted backend on x86_64-solaris/illumos
https://github.com/ziglang/zig/issues/25699
2025-10-25 12:44:13 +02:00
Alex Rønne Petersen
bebfdc3661 llvm: remove some workarounds in loadTruncate()
No longer needed with LLVM 21.
2025-10-25 04:52:46 +02:00