Commit graph

12062 commits

Author SHA1 Message Date
Alex Rønne Petersen
1c342ca7c3
libc: Add NetBSD libc startup code from 10.1.
* sysident_assym.h was manually expanded.
    * The ELF_NOTE_MARCH_DESC and ELF_NOTE_MARCH_DESCSZ macros will be defined
      by the compiler.
* Legacy .init/.fini stuff was removed.
* GCJ nonsense was removed.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
35f8121194
std.zig.LibCDirs: Add NetBSD libc support. 2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
553cb3ed46
libc: Add NetBSD system and libc headers from 10.1.
sys/param.h was manually adjusted to not define __NetBSD_Version__ since it will
be defined by the compiler.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
6028db7f29
std.Target: Add isNetBSDLibC() function. 2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
8a7d925d36
std.Target: Fix requiresLibC() for NetBSD. 2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
3d6f83b331
std.Target: Adjust DynamicLinker.standard() for NetBSD.
* powerpc64 does not appear to be a thing.
* riscv32/riscv64 have not had actual releases yet.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
9af8e7c68e
std.c: Fill out some missing definitions for supported NetBSD libc targets.
This allows ubsan-rt to build.
2025-05-17 04:41:26 +02:00
Marc Tiehuis
224e39316f std.hash.Wyhash: fix dangling stack pointer
Closes #23895.
2025-05-16 15:28:20 +02:00
HydroH
cc1475c91d
std: remove std.crypto.Certificate.Parsed.pubKeySigAlgo method (#23811) 2025-05-16 00:21:25 +02:00
wooster0
56fad6a195 make error messages prettier
Error messages never contain periods or grave accents.
Get rid of the periods and use apostrophes instead in
probably the only two error messages that had them.
2025-05-15 16:39:15 +01:00
Bryson Miller
08d534e8d8
Introduce common strcasecmp and strncasecmp implementations (#23840) 2025-05-15 10:58:33 +02:00
Alex Rønne Petersen
bc377183ce reduce: Fix build due to std.mem.Alignment changes.
Closes #23884.
2025-05-15 03:13:41 +02:00
Isaac Freund
bc2f7c7547 Revert "Work around stage1 not yet returning null-terminated @typeInfo strings"
This reverts commit c8fa767f08.
2025-05-14 06:47:23 +02:00
Cezary Kupaj
518105471e
Fix SIGSEGV handler for AArch64 Darwin targets
* ucontext_t ptr is 8-byte aligned instead of 16-byte aligned which @alignCast() expects
* Retrieve pc address from ucontext_t since unwind_state is null
* Work around __mcontext_data being written incorrectly by the kernel
2025-05-14 05:38:38 +02:00
Alex Rønne Petersen
5b606d435d
Merge pull request #21882 from alexrp/compiler-fixes
compiler: Fix some real and theoretical miscompilations with `allowzero` and `volatile`
2025-05-13 10:42:05 +02:00
wooster0
a365971a33 std.meta.intToEnum -> std.enums.fromInt
Also use an optional as the return type instead of an error code.
2025-05-13 07:28:41 +02:00
Alex Rønne Petersen
a3693aae3a
Merge pull request #23856 from alexrp/backport-llvm-120036 2025-05-13 01:08:07 +02:00
Alex Rønne Petersen
bc3c50c21e
Merge pull request #23700 from sorairolake/rename-trims
chore(std.mem): Rename `trimLeft` and `trimRight` to `trimStart` and `trimEnd`
2025-05-12 17:11:52 +02:00
Alex Rønne Petersen
9d8adb38a1
std.Build: Make no_builtin a property of Module instead of Step.Compile.
This reflects how the compiler actually treats it.

Closes #23424.
2025-05-12 17:08:22 +02:00
Alex Rønne Petersen
fe5dbc2474
std.Build: Change Step.Compile.no_builtin from bool to ?bool.
To be in line with other, similar options.
2025-05-12 17:07:50 +02:00
Alex Rønne Petersen
8285de62d5
Merge pull request #23745 from alexrp/target-os-versions
`std.Target`: Update supported OS version ranges
2025-05-12 16:59:46 +02:00
Linus Groh
abbead1fb8 libc: update macOS headers to SDK 15.2 2025-05-12 16:50:17 +02:00
Alex Rønne Petersen
d14f7f7a09
libtsan: Backport llvm/llvm-project#120036.
https://github.com/llvm/llvm-project/pull/120036
2025-05-12 16:24:59 +02:00
Alex Rønne Petersen
833d4c9ce4
Merge pull request #23835 from alexrp/freebsd-libc
Support dynamically-linked FreeBSD libc when cross-compiling
2025-05-12 01:19:23 +02:00
Alex Rønne Petersen
c3906718b3
Merge pull request #23810 from alexrp/more-test-targets 2025-05-11 20:52:47 +02:00
Alex Rønne Petersen
837e0f9c37 std.Target: Remove ObjectFormat.nvptx (and associated linker code).
Textual PTX is just assembly language like any other. And if we do ever add
support for emitting PTX object files after reverse engineering the bytecode
format, we'd be emitting ELF files like the CUDA toolchain. So there's really no
need for a special ObjectFormat tag here, nor linker code that treats it as a
distinct format.
2025-05-10 12:21:57 +02:00
Alex Rønne Petersen
0e3609b8e0
std.Target: Factor arch/ABI into FreeBSD minimum OS version selection.
Based on data in std.zig.target.
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
eeaa1b17c6
std.zig.target: Add FreeBSD libc support. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
be566a4c11
libc: Add FreeBSD libc abilists file.
Currently covers version 1.7 (FreeBSD 14.0.0).
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
a36dcef7dc
libc: Add FreeBSD libc startup code from 14.2.0.
* NT_FREEBSD_ABI_TAG was manually adjusted from using a hardcoded value to using
  __FreeBSD_version which will be defined by the compiler.
* GCJ stuff was removed.
* HAVE_CTORS definitions were removed.
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
01390cc533
std.zig.LibCDirs: Add FreeBSD libc support. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
6e64bc845f
libc: Add FreeBSD system and libc headers from 14.2.0.
osreldate.h and sys/param.h were manually adjusted to not __FreeBSD_version
since it will be defined by the compiler.
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
309ff9c34e
std.Target: Add isFreeBSDLibC() function. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
46042170cb
std.Target: Fix requiresLibC() for FreeBSD. 2025-05-10 12:19:26 +02:00
David
2c241b263c
Introduce common bzero libc implementation. (#23812)
* Introduce common `bzero` libc implementation.

* Update test name according to review

Co-authored-by: Linus Groh <mail@linusgroh.de>

* address code review

- import common implementation when musl or wasi is included
- don't use `c_builtins`, use `@memset`

* bzero calling conv to .c

* Apply review

Co-authored-by: Veikka Tuominen <git@vexu.eu>

---------

Co-authored-by: Linus Groh <mail@linusgroh.de>
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2025-05-10 10:37:21 +02:00
Alex Rønne Petersen
85431e745c libcxx: Backport llvm/llvm-project#137594. 2025-05-10 09:10:27 +02:00
Michael Pfaff
49c7318056 Fix implementation of std.os.linux.accept on x86 2025-05-10 02:24:33 +02:00
Pat Tullmann
6eb5e56306 std.posix: Add sigrtmin() and sigrtmax()
For C code the macros SIGRTMIN and SIGRTMAX provide these values.  In
practice what looks like a constant is actually provided by a libc call.
So the Zig implementations are explicitly function calls.

glibc (and Musl) export a run-time minimum "real-time" signal number,
based on how many signals are reserved for internal implementation details
(generally threading).  In practice, on Linux, sigrtmin() is 35 on glibc
with the older LinuxThread and 34 with the newer NPTL-based
implementation.  Musl always returns 35.  The maximum "real-time" signal
number is NSIG - 1 (64 on most Linux kernels, but 128 on MIPS).

When not linking a C Library, Zig can report the full range of "rt"
signals (none are reserved by Zig).

Fixes #21189
2025-05-09 15:10:25 +02:00
Alex Rønne Petersen
23cb2b2662
std.Target: Handle {powerpc64,riscv32}-netbsd in DynamicLinker.standard(). 2025-05-09 14:07:40 +02:00
Meghan Denny
a5cfa3db3a std.os: handle ENOENT for fnctl on macos 2025-05-09 11:20:42 +02:00
HydroH
32bf1fbf46 std: fix error.Unexpected on certain Windows file operations
Closes #23690.
2025-05-09 08:57:00 +02:00
Alex Rønne Petersen
c272ddc070
std: Disable os.linux.test.test.fallocate on MIPS N32.
https://github.com/ziglang/zig/issues/23809
2025-05-08 21:32:22 +02:00
Alex Rønne Petersen
2261d13759
std: Disable posix.test.test.fchmodat smoke test on MIPS N32.
https://github.com/ziglang/zig/issues/23808
2025-05-08 21:32:22 +02:00
Alex Rønne Petersen
dd1de18f96
std: Disable hash.xxhash.test.xxhash3 on MIPS N32.
https://github.com/ziglang/zig/issues/23807
2025-05-08 21:32:22 +02:00
Alex Rønne Petersen
d381645c73
std: Disable fs.test.test.setEndPos on MIPS N32.
https://github.com/ziglang/zig/issues/23806
2025-05-08 21:32:22 +02:00
Alex Rønne Petersen
d3e8541268
std.Target: Prune dead targets in Abi.default() and DynamicLinker.standard(). 2025-05-08 21:32:20 +02:00
Seiichi Uchida
bbc21393b4 Add register_file_alloc_range 2025-05-06 18:01:07 +02:00
Alex Rønne Petersen
35f30558ad
std.Build: Rename --glibc-runtimes to --libc-runtimes and enable it for musl. 2025-05-06 01:52:47 +02:00
HydroH
a14352b0b2
std: fix compile errors in std.crypto.ecc (#23797)
Implemented `neg()` method for `AffineCoordinates` struct of p256,
p384 and secp256k1 curves.

Resolves: #20505 (partially)
2025-05-05 18:50:25 +00:00
David Rubin
369177f0ba
crypto: add sub function to Ristretto255 (#23724) 2025-05-05 15:30:59 +02:00