zig/lib
taylor.fish 427f0025db
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 03:50:34 +02:00
..
build-web webui: fixup build errors in fuzz / time_report 2025-09-12 02:32:06 +02:00
c libc: implement common abs for various integer sizes (#23893) 2025-05-21 00:57:38 +02:00
compiler zig reduce: adapt to new Writer API 2025-08-22 04:19:31 +02:00
compiler_rt compiler-rt: export __aeabi_read_tp for arm-freebsd 2025-09-12 02:35:41 +02:00
docs std.io.Writer.Allocating: rename getWritten() to written() 2025-08-13 01:43:52 -07:00
include zig cc: Update intrinsic headers to Clang 20. 2025-04-04 06:08:09 +02:00
init fix: fix typo in comment by removing repeated 'business' word 2025-08-25 18:51:34 +02:00
libc glibc: guard inet-fortified.h 2025-09-24 03:50:29 +02:00
libcxx libcxx: Fix locale-related compilation errors on NetBSD. 2025-06-06 11:22:20 +02:00
libcxxabi libcxxabi: Update to Clang 20. 2025-04-04 06:08:09 +02:00
libtsan tsan: remove usage of libnvmm and libncurses headers on netbsd 2025-08-14 07:11:07 +02:00
libunwind libunwind: Fix return type of DwarfFDECache<A>::findFDE() 2025-06-30 06:40:17 +02:00
std Fix PowerPC syscalls causing invalid code from CBE 2025-09-24 03:50:34 +02:00
c.zig libc: implement common abs for various integer sizes (#23893) 2025-05-21 00:57:38 +02:00
compiler_rt.zig aarch64: implement more optional/error union/union support 2025-07-26 21:39:50 -04:00
fuzzer.zig build system: replace fuzzing UI with build UI, add time report 2025-08-01 23:48:21 +01:00
ubsan_rt.zig ubsan-rt: export symbols with hidden visibility 2025-08-25 18:50:59 +02:00
zig.h cbe: emit nonstring attribute 2025-08-11 11:30:51 -07:00