34969 Commits

Author SHA1 Message Date
Andrew Kelley
3764f7b0f2 compiler: disable InternPool.debug_state as it is unsound
There can be more than one InternPool instance active at the same time.
2025-09-24 20:01:19 -07:00
Andrew Kelley
aa92c237e9 aro does not have a pragma-pack warning 2025-09-24 20:01:19 -07:00
Andrew Kelley
8cba6b1df8 aro: update
This is f5fb720a5399ee98e45f36337b2f68a4d23a783c plus ehaas's nonnull
attribute pull request currently at 4b26cb3ac610a0a070fc43e43da8b4cdf0e9101b
with zig patches intact.
2025-09-24 20:01:19 -07:00
Andrew Kelley
01132e0cf8 remove behavior test that depended on std.zig.c_translation
behavior tests may not depend on this namespace.
2025-09-24 20:01:19 -07:00
Andrew Kelley
79d9997d22 delete @cImport tests
These are now maintained in a separate repository: ziglang/translate-c
2025-09-24 20:01:19 -07:00
Andrew Kelley
e1d6f478c9 @cImport: don't pass args to Aro it doesn't understand 2025-09-24 20:01:19 -07:00
Andrew Kelley
9ad1e83e63 zig fmt 2025-09-24 20:01:19 -07:00
Andrew Kelley
f4d328e2ac Compilation: use renameTmpIntoCache
solves several problems with this pattern
2025-09-24 20:01:19 -07:00
Andrew Kelley
f0d3b7abb8 aro: fix dep file logic
also add ability to omit main source file from dep file as it messes up
caching strategy
2025-09-24 20:01:19 -07:00
Andrew Kelley
9e979e5a9d Compilation: re-implement cImport 2025-09-24 20:01:19 -07:00
Andrew Kelley
ea169e6ccf std.Build.Cache: clarify parameter is sub path, not basename 2025-09-24 20:01:19 -07:00
Andrew Kelley
b6930097ec translate-c: update for array list defaults 2025-09-24 20:01:19 -07:00
Andrew Kelley
e5f4dbdf8a fix rebase conflicts 2025-09-24 20:01:19 -07:00
Andrew Kelley
2f00b630f2 remove c_builtins.zig from cmake 2025-09-24 20:01:19 -07:00
Andrew Kelley
0f88f9c664 aro: avoid BoundedArray 2025-09-24 20:01:19 -07:00
Veikka Tuominen
21f5f06f1f Compilation: avoid passing Clang specific options to Aro 2025-09-24 20:01:18 -07:00
Veikka Tuominen
e7a622fb33 update aro and translate-c sources 2025-09-24 20:01:18 -07:00
Ryan Liptak
e8e8d7e5c8 resinator: Update for latest aro 2025-09-24 20:01:18 -07:00
Andrew Kelley
01d993b230 add translate-c CLI args 2025-09-24 20:01:18 -07:00
Andrew Kelley
8e27821b60 simplify diagnostics 2025-09-24 20:01:18 -07:00
Andrew Kelley
d1820d2a3e delete enough aro to make it compile 2025-09-24 20:01:18 -07:00
Andrew Kelley
328280b566 move translate-c helpers 2025-09-24 20:01:18 -07:00
Andrew Kelley
1bdcdbd996 delete all the translate-c tests
the ziglang/translate-c package has its own test suite, so these are
redundant
2025-09-24 20:01:17 -07:00
Andrew Kelley
f49a54745b compiler: update aro and translate-c to latest; delete clang translate-c 2025-09-24 19:57:28 -07:00
Alex Rønne Petersen
91b0adc4c1
Merge pull request #25231 from taylordotfish/bugfix/ppc-restore_rt
Fix `restore_rt` on PowerPC and remove unnecessary clobbers
2025-09-25 01:31:24 +02:00
Jacob Young
4a344de651 MappedFile: fix the insert range path not updating the root node 2025-09-24 16:09:46 -07:00
Jacob Young
94d319a10f x86_64: support more in/out forms
Closes #25303
2025-09-24 16:09:14 -07:00
Jacob Young
561e556aaf target: check for backend support for the new linker
Closes #25343
2025-09-24 16:08:26 -07:00
rpkak
9b3b7aa911 Integrate libc-test cases into the build system
zig build test-libc -Dlibc-test-path=/path/to/libc-test
2025-09-24 16:05:18 -07:00
rpkak
4fb08986cb optimize std.mem.swap 2025-09-24 12:29:43 -07:00
taylor.fish
c73df65ded Don't specify clobbers in restore_rt
Per @alexrp, this is unnecessary in naked functions.
2025-09-23 21:03:28 -07:00
taylor.fish
7f49dae284 Fix PowerPC restore_rt
Clang fails to compile the CBE translation of this code ("non-ASM
statement in naked function"). Similar to the implementations of
`restore_rt` on x86 and ARM, when the CBE is in use, this commit employs
alternative inline assembly that avoids using non-immediate input
operands.
2025-09-23 20:47:34 -07:00
Carter Snook
5bf52a6f50
std: always allow spawning processes when an env map is explicitly provided (#25092)
In a library, the two `builtin.link_libc` and `builtin.output_mode ==
.Exe` checks could both be false. Thus, you would get a compile error
even if you specified an `env_map` at runtime. This change turns the
compile error into a runtime panic and updates the documentation to
reflect the runtime requirement.
2025-09-24 03:12:28 +02:00
rpkak
bc512648db use copy_file_range syscall on linux 2025-09-24 03:08:12 +02:00
Kyle Schwarz
6260d2772f glibc: guard inet-fortified.h 2025-09-24 02:55:50 +02:00
taylor.fish
bdca0f93c4 Fix PowerPC syscalls causing invalid code from CBE
Fixes #25209.

On PowerPC, some registers are both inputs to syscalls and clobbered by
them. An example is r0, which initially contains the syscall number, but
may be overwritten during execution of the syscall.

musl and glibc use a `+` (read-write) constraint to indicate this, which
isn't supported in Zig. The current implementation of PowerPC syscalls
in the Zig standard library instead lists these registers as both inputs
and clobbers, but this results in the C backend generating code that is
invalid for at least some C compilers, like GCC, which doesn't support
the specifying the same register as both an input and a clobber.

This PR changes the PowerPC syscall functions to list such registers as
inputs and outputs rather than inputs and clobbers. Thanks to jacobly0
who pointed out that it's possible to have multiple outputs; I had
gotten the wrong idea from the documentation.
2025-09-24 02:54:55 +02:00
Andrew Kelley
ba137783ed
forbid trivial local address returned from functions (#25333)
progress towards #25312
2025-09-23 23:37:53 +00:00
Alex Rønne Petersen
7b92d5f405
std.pie: fix register constraint in getDynamicSymbol() for s390x (#25327)
If the compiler happens to pick `ret = r0`, then this will assemble to
`ag r0, 0` which is obviously not what we want. Using `a` instead of `r` will
ensure that we get an appropriate address register, i.e. `r1` through `r15`.

Re-enable pie_linux for s390x-linux which was disabled in
ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-22 18:36:47 +02:00
Alex Rønne Petersen
26825e9506
Merge pull request #25324 from alexrp/freebsd
Some changes to prepare for FreeBSD CI
2025-09-22 05:04:31 +02:00
Alex Rønne Petersen
16c18b835e
ci: stop building FreeBSD module tests on x86_64-linux
They're now built on the x86_64-freebsd machine.
2025-09-22 01:39:29 +02:00
alexrp
3675074c7c
ci: add x86_64-freebsd scripts 2025-09-22 01:37:32 +02:00
alexrp
b3432c2796
test: disable some stack trace tests on FreeBSD 2025-09-22 01:37:32 +02:00
alexrp
b2d2b441b2
test: disable test-link on FreeBSD
https://github.com/ziglang/zig/issues/25323
2025-09-22 01:37:32 +02:00
alexrp
f7d62009ff
std.posix: remove bogus assert that SIGRTMAX < NSIG 2025-09-22 01:37:32 +02:00
alexrp
0700ec35bd
compiler: don't use self-hosted backend on any BSD yet
There are some blocking bugs in the self-hosted ELF linker.
2025-09-22 01:37:32 +02:00
Jacob Young
f58200e3f2 Elf2: create a new linker from scratch
This iteration already has significantly better incremental support.

Closes #24110
2025-09-21 14:09:14 -07:00
Andrew Kelley
2a97e0af6d CI: stop testing x86_64-macos
There are two reasons for this:

1. Apple is about to drop support for this target. Zig will keep support
   but move it to a lower tier - one that does not require continuous CI
   testing. Support for this target will be maintained by the enthusiasm
   of contributors but will not block other bug fixes and enhancements.
2. This is our only non-self-hosted action runner. We are migrating away
   from GitHub soon at which point this runner will no longer be
   available.
2025-09-21 12:36:50 -07:00
Alex Rønne Petersen
4d8dcccbd4
ci: temporarily disable riscv64-linux
GitHub sucks:

    Sep 20 20:49:21 ganymede runsvc.sh[82817]: An error occured: Runner version v2.326.0 is deprecated and cannot receive messages.
    Sep 20 20:49:21 ganymede runsvc.sh[82817]: Runner listener exited with error code 1
    Sep 20 20:49:21 ganymede runsvc.sh[82817]: Runner listener exit with terminated error, stop the service, no retry needed.
2025-09-21 17:29:57 +02:00
Frank Denis
bdc31c9561 aarch64/zonCast: don't return a pointer to a stack element
Elements are computed at comptime, so don't declare them as "var".
2025-09-21 05:01:41 -07:00
Andrew Kelley
594cb38fcb
Merge pull request #25302 from ziglang/growCapacity
std: remove loop from growCapacity
2025-09-21 04:55:39 -07:00