zig/lib/std/os/linux
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
..
bpf linux/bpf: add alignment for helper functions to make compiler happy 2024-11-18 16:19:44 +01:00
aarch64.zig remove condition codes 2025-07-16 10:27:39 -07:00
arm.zig zig fmt 2025-07-16 10:27:39 -07:00
bpf.zig bpf: use bitCast instead of intCast in ld_imm_impl 2025-09-15 15:24:30 +02:00
hexagon.zig zig fmt 2025-07-16 10:27:39 -07:00
io_uring_sqe.zig io_uring: add setsockopt/getsockopt 2025-03-05 13:35:52 +01:00
ioctl.zig std.Target: Remove sparcel architecture tag. 2024-07-30 06:30:25 +02:00
IoUring.zig implement registering NAPI on IoUring (#24850) 2025-08-16 09:18:49 +02:00
loongarch64.zig canonicalize loongarch clobbers 2025-07-16 10:27:40 -07:00
m68k.zig zig fmt 2025-07-16 10:27:39 -07:00
mips.zig linux/mips.zig: Use i32 for stat nsec fields 2025-08-06 22:12:41 -07:00
mips64.zig canonicalize loongarch clobbers 2025-07-16 10:27:40 -07:00
powerpc.zig Fix PowerPC syscalls causing invalid code from CBE 2025-09-24 02:54:55 +02:00
powerpc64.zig Fix PowerPC syscalls causing invalid code from CBE 2025-09-24 02:54:55 +02:00
riscv32.zig zig fmt 2025-07-16 10:27:39 -07:00
riscv64.zig zig fmt 2025-07-16 10:27:39 -07:00
s390x.zig zig fmt 2025-07-16 10:27:39 -07:00
seccomp.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
sparc64.zig zig fmt 2025-07-16 10:27:39 -07:00
syscalls.zig Linux: Update syscall list for 6.16 2025-08-14 10:22:15 +10:00
test.zig linux: futex v2 API updates 2025-06-18 19:53:50 -07:00
thumb.zig zig fmt 2025-07-16 10:27:39 -07:00
tls.zig zig fmt 2025-07-16 10:27:39 -07:00
vdso.zig std.dynamic_library: update to new elf API 2024-10-12 10:44:17 -07:00
x86.zig zig fmt 2025-07-16 10:27:39 -07:00
x86_64.zig zig fmt 2025-07-16 10:27:39 -07:00