Andrew Kelley
513389bc5b
CLI: exploit std.mem.chompPrefix
...
fixes a bug in how -fstructured-cfg and -fno-structured-cfg are handled.
2025-09-25 10:50:41 -07:00
Andrew Kelley
ac4d79e322
std.mem: introduce chompPrefix and chompSuffix
2025-09-25 10:50:41 -07:00
Alex Rønne Petersen
a73f246b29
std.Thread: disable test on armeb in addition to thumbeb
...
Same falky failure on both. See ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-25 17:49:47 +02:00
Alex Rønne Petersen
dd4be26f53
libc-test: disable daemon-failure.c
...
It's flaky in that systems with a high FD limit will get an unexpected ENOMEM
error from daemon(), failing the test.
2025-09-25 12:57:56 +02:00
Jacob Young
6257f4abb7
x86_64: improve support for large enums
...
Closes #25247
2025-09-24 21:20:27 -07:00
Zhenming-Lin
99323a4da1
improve impl of __floorh, __floorx, __ceilh and __ceilx
2025-09-24 20:57:25 -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
Andrew Kelley
010d9a63f2
Merge pull request #25154 from ziglang/no-decl-val-3
...
rework byval ZIR instructions; forbid runtime vector indexes
2025-09-21 01:49:28 -07:00
Andrew Kelley
633162eb0c
add behavior test: comptime C pointer to optional pointer
2025-09-20 18:58:32 -07:00
Andrew Kelley
1c9ac9dbb7
add behavior test: avoid unused field function body compile error
2025-09-20 18:51:43 -07:00
Andrew Kelley
500afbf076
add behavior test: resist alias of explicit copy...
...
...of array passed as arg
closes #22906
2025-09-20 18:51:26 -07:00
Andrew Kelley
ed7ff0b693
allow some test cases to regress
...
tracked by #24061 - these should be re-enabled once that is solved.
2025-09-20 18:33:01 -07:00
mlugg
0e16d933be
fix rebase error
2025-09-20 18:33:01 -07:00
mlugg
20925f2957
Revert "frontend: another packedStructFieldPtrInfo fix"
...
This reverts commit dedccecda944f88a5278c12c24ffbea46126de63.
2025-09-20 18:33:01 -07:00
Jacob Young
f81a721e41
standalone: fix misaligned stack crash
2025-09-20 18:33:01 -07:00
Jacob Young
5144f10ec9
aarch64: fix behavior failures
2025-09-20 18:33:01 -07:00
Jacob Young
60cdacaff2
x86_64: rewrite vector element pointer access
2025-09-20 18:33:01 -07:00
Andrew Kelley
2ba03e98c8
disable failing stage2_aarch64 behavior tests
2025-09-20 18:33:01 -07:00
Andrew Kelley
5d8c1fb6ab
frontend: another packedStructFieldPtrInfo fix
...
it was calculating host integer size in a wrong way. just use integer
abi size
2025-09-20 18:33:01 -07:00
mlugg
baaf715d21
cases: update for new error
...
The latest bugfix reverted this case to its old behavior (which is a
reasonable behavior to have).
2025-09-20 18:33:01 -07:00
mlugg
fcc7e378f8
Revert "delete failing test case"
...
This reverts commit ba4d4602ab9bb0dc17fc0d57141d9324bdbb356d.
2025-09-20 18:33:01 -07:00
mlugg
2f9d8d5a9b
Zcu: fix analysis of type of decl with inferred type
...
If the `nav_ty` is resolved by the `nav_val`, then we need to also mark
the `nav_ty` as in progress when we begin resolving the `nav_val`.
2025-09-20 18:33:01 -07:00
Andrew Kelley
d7d50496d9
langref: don't assume too much about pointer to packed struct field
2025-09-20 18:33:01 -07:00
Andrew Kelley
725dec6aa7
Sema: add missed logic to checkPtrAttributes
...
It wasn't checking bit pointer data.
2025-09-20 18:33:01 -07:00
Andrew Kelley
7ffe068a79
delete failing test case
...
Matthew can revert this commit when he's ready to tackle the assertion
failure
2025-09-20 18:33:01 -07:00