0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Geyslan Gregório 503b03daa3 std.os.linux: declare $a3 as an output of mips syscall4 and up
On MIPS, $a3 ($7) carries the fourth argument [1] and returns the
kernel's error flag [2]. The kernel writes the flag on every return,
success included [3]. syscall4 and up declared $7 an input only, so
the compiler assumed it still held the argument after the syscall.
In release builds, a pointer passed as the fourth argument then reads
back as the flag, 0 on success, and using it faults at address 0.

Commit 5b29b4ffa6 ("Fix MIPS inline assembly clobbers") took $7 out of
the clobbers, since an input cannot be one, but never made it an
output.

Add that output, as alpha.zig does for its argument registers [4]
and musl does with "+r" [5]. $7 stays out of the clobbers, because a
register that is input, output and clobber at once can miscompile (#35724).

[1] - https://refspecs.linuxfoundation.org/elf/mipsabi.pdf#page=24
[2] - https://man7.org/linux/man-pages/man2/syscall.2.html
[3] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/kernel/scall32-o32.S?h=v7.1#n112
[4] - d893812013/lib/std/os/linux/alpha.zig (L38-L46)
[5] - https://git.musl-libc.org/cgit/musl/tree/arch/mips/syscall_arch.h?h=v1.2.6#n81

closes #37247
History 2026-10-15 19:33:50 +02:00
..
Build std.Build.Cache: fix cache miss when metadata changes 2026-10-15 08:17:27 +02:00
c Threaded: implement process spawning for macOS 2026-09-26 19:08:50 -04:00
compress flate.Decompress: Fix potential infinite loop when using limits 2026-08-14 12:26:14 +02:00
crypto Remove dead code in kangarootwelve 2026-10-15 10:09:06 +02:00
debug std.debug.cpu_context: signal context conversion for sparc*-netbsd/openbsd 2026-10-11 15:00:48 +02:00
dwarf Dwarf2: start implementing decl debug info 2026-09-03 12:59:38 -04:00
fmt cbe: update for compiler_rt abi changes 2026-07-27 14:35:12 -04:00
fs Threaded.fileStatWindows: disambiguate between files and named pipes 2026-10-09 23:35:36 -07:00
hash std.hash: fix inconsistent spacing 2026-08-04 16:11:48 +02:00
heap Threaded: implement new process spawning API for windows 2026-09-26 19:08:50 -04:00
http std.http: improve tolerance of request-body edge cases 2026-10-12 20:08:17 +02:00
Io std.Io.Threaded: handle unsupported renamePreserveLinux 2026-10-13 13:26:23 -07:00
json std.lang: rename OptimizeMode to Optimize 2026-07-20 17:26:50 -07:00
lang std: add basic target information for m88k-openbsd 2026-05-23 11:02:55 +02:00
math math: simplify code 2026-10-08 01:15:20 +02:00
mem Clean up doc comments 2026-09-26 12:35:38 -07:00
meta Remove pub modifier from const Self = @This() expressions 2026-07-22 20:37:12 +02:00
os std.os.linux: declare $a3 as an output of mips syscall4 and up 2026-10-15 19:33:50 +02:00
posix remove support for wasi-libc 2026-10-04 18:23:18 +02:00
process remove support for wasi-libc 2026-10-04 18:23:18 +02:00
Random std.Random.{Xoshiro256,Xoroshiro128}: point URLs directly at upstream impls 2026-09-16 03:23:15 +02:00
sort std.sort.pdq: push larger partition to stack to avoid stack overflow 2026-09-05 17:50:56 +02:00
tar Update usages of most deprecated APIs 2026-08-05 03:40:30 +02:00
Target std.Target: update CPU models and features to LLVM 23 2026-10-07 00:30:51 +02:00
testing Update usages of most deprecated APIs 2026-08-05 03:40:30 +02:00
time zig fmt 2026-07-17 23:30:26 +02:00
tz Support legacy TZ format, expose header struct to a potential writer 2022-01-01 12:47:08 +00:00
unicode remove uses of array multiplication 2026-04-30 08:57:51 +01:00
valgrind zig fmt 2026-07-17 23:30:26 +02:00
zig std.Target: remove contiki OS tag 2026-10-12 14:43:32 +02:00
zip/testdata Add zip.extractTo test cases (#35748) 2026-06-17 23:22:55 +02:00
zon ZON: Fix parsing from a specific node with fromZoir() (#37193) 2026-10-15 15:07:27 +02:00
array_hash_map.zig chore(MultiArrayList): update .{} to .empty 2026-10-09 23:13:33 +02:00
array_list.zig std.ArrayList: add "see also" doc comment 2026-09-16 13:12:46 -07:00
ascii.zig Simplify return type of hexEscape 2026-07-31 16:19:58 -04:00
atomic.zig std.atomic: fix conditions for using yield on arm/thumb in spinLoopHint 2026-08-09 17:53:04 +02:00
base64.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
bit_set.zig Merge pull request 'Rewrite incr-check into a more general purpose compiler test runner' (#36967) from compiler-test-runner into master 2026-09-28 07:13:35 +02:00
BitStack.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
buf_map.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
buf_set.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
Build.zig allow standardOptimizeOption to return null 2026-10-09 10:14:16 +02:00
c.zig std.c: fix NCCS value for all linux and hurd targets 2026-10-15 19:29:42 +02:00
coff.zig zig fmt 2026-07-17 23:30:26 +02:00
compress.zig std.compress: rework flate to new I/O API 2025-07-31 22:10:11 -07:00
crypto.zig Add core.keccak to the crypto.zig tests 2026-10-15 10:09:06 +02:00
debug.zig std.debug.assert: remove @disableInstrumentation 2026-10-09 17:46:28 -07:00
deque.zig std.ArrayListUnmanaged: last and lastPtr methods (#36318) 2026-08-07 07:30:10 +02:00
DoublyLinkedList.zig std.SinglyLinkedList and std.DoublyLinkedList: make pointer param const in remove 2026-08-26 23:22:27 +02:00
dwarf.zig Dwarf: cleanup emitted debug info 2024-08-22 08:44:08 +02:00
dynamic_library.zig std.DynLib: find libraries located in /lib64 and /usr/lib64 2026-08-23 14:16:37 +02:00
elf.zig std.elf: fix Elf64_auxv_t layout on NetBSD and OpenBSD 2026-10-04 18:33:19 +02:00
enums.zig Add EnumMap.empty, deprecate default fields 2026-09-12 09:28:55 +02:00
fmt.zig fix(#36798): nonexhaustive enums are no longer printed as @enumFromInt, but as @fromBackingInt 2026-09-11 13:05:21 +02:00
fs.zig std: find a better home for the "preopens" concept 2026-01-08 05:06:31 +01:00
hash.zig std.hash.crc: embrace standard names 2026-06-26 16:07:53 -07:00
hash_map.zig std.hash_map: fix compile error in removeByPtr() 2026-10-12 12:49:48 +02:00
heap.zig std.elf: add AT_* constants for more OSs and namespace them properly 2026-09-07 01:29:49 +02:00
http.zig std.http: improve tolerance of request-body edge cases 2026-10-12 20:08:17 +02:00
Io.zig Remove extern from Io.Mutex (#37081) 2026-10-10 19:11:35 +02:00
json.zig rename std.Io.GenericReader to std.Io.Reader in outdated doc comment 2026-05-17 19:48:12 +03:00
lang.zig compiler: add x86_64, aarch64, riscv, and loongarch preserve_most calling convention support 2026-10-12 10:49:23 +02:00
leb128.zig std.meta: Remove Int in favor of @Int 2026-05-03 21:42:06 +01:00
log.zig std.lang.OptimizeMode -> std.lang.Optimize migration progress 2026-08-23 14:30:48 +02:00
macho.zig compiler: move Darwin framework resolution to the frontend 2026-09-27 10:19:55 +01:00
math.zig llvm: enable passing tests 2026-07-27 14:44:41 -04:00
mem.zig std.mem: introduce copySentinelInclusive 2026-09-07 16:44:06 -07:00
meta.zig std.meta: deprecate fieldInfo, fieldNames, fieldTypes 2026-08-08 19:15:10 +02:00
multi_array_list.zig feat(MultiArrayList): Pointer Stability 2026-10-09 23:14:28 +02:00
os.zig std.os: no longer require libc for sh(eb)-linux 2026-06-04 17:05:00 +02:00
pdb.zig pdb: fix crash during symbol lookup 2026-10-07 00:30:52 +02:00
pie.zig std.pie: fix calculation of _DYNAMIC's offset 2026-08-11 01:02:54 +02:00
posix.zig std.posix: Add missing cmsghdr and cmsg_align in else 2026-10-09 10:16:56 +02:00
priority_dequeue.zig priority queue and dequeue: use *const Self in read-only methods and fix deinit (#31712) 2026-04-03 22:20:46 +02:00
priority_queue.zig priority queue and dequeue: use *const Self in read-only methods and fix deinit (#31712) 2026-04-03 22:20:46 +02:00
process.zig std.process: match can_spawn and can_replace to Apple SDK availability 2026-10-04 10:39:43 +04:00
Progress.zig Change usages of fmt.bufPrint* to mem.print* (#36263) 2026-09-01 02:21:28 +02:00
Random.zig lib: use @divCeil 2026-07-06 20:49:09 +02:00
SemanticVersion.zig Prefer <err> => |e| return e over <err> => return <err> 2026-04-20 18:03:14 -07:00
simd.zig zig fmt 2026-07-17 23:30:26 +02:00
SinglyLinkedList.zig std.SinglyLinkedList and std.DoublyLinkedList: make pointer param const in remove 2026-08-26 23:22:27 +02:00
sort.zig std.sort: clarify description of equalRange 2026-04-16 19:42:00 +02:00
spirv.zig std.spirv: add setMeshOutputs() function 2026-08-29 20:03:14 +02:00
start.zig move std.os.linux.tls to compiler_rt as __zig_elf_static_tls_* 2026-10-05 03:26:41 +02:00
static_string_map.zig zig fmt 2026-07-17 23:30:26 +02:00
std.zig std.lang: rename OptimizeMode to Optimize 2026-07-20 17:26:50 -07:00
tar.zig zig fmt 2026-07-17 23:30:26 +02:00
Target.zig std.Target: add standard dynamic linker paths for managarm 2026-10-12 14:59:18 +02:00
testing.zig std.testing: refuse resizes in checkAllAllocationFailures (#37142) 2026-10-09 21:55:17 +02:00
Thread.zig move std.os.linux.tls to compiler_rt as __zig_elf_static_tls_* 2026-10-05 03:26:41 +02:00
time.zig std: finish moving time to Io interface 2026-02-02 23:02:31 -08:00
treap.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
tz.zig std.tz: fix redundant endian handling 2025-08-28 18:30:57 -07:00
unicode.zig std.unicode: add peekCodepoint (#31038) 2026-07-28 21:01:34 +02:00
Uri.zig Change usages of fmt.bufPrint* to mem.print* (#36263) 2026-09-01 02:21:28 +02:00
valgrind.zig zig fmt 2026-07-17 23:30:26 +02:00
wasm.zig zig fmt 2026-07-17 23:30:26 +02:00
zig.zig Merge pull request 'std.zig.stringEscape: Escape invalid/disallowed UTF-8 sequences' (#36923) from squeek502/zig:string-escape-utf8 into master 2026-09-28 22:23:47 +02:00
zip.zig Update usages of most deprecated APIs 2026-08-05 03:40:30 +02:00
zon.zig zon: add fmt function 2026-08-02 21:40:32 +02:00