Commit graph

10791 commits

Author SHA1 Message Date
Alex Rønne Petersen
731d6531bf
std.Target: Bump minimum Linux kernel version to 5.10.
This is the kernel in Debian LTS (bullseye).
2025-04-11 21:10:55 +02:00
Alex Rønne Petersen
ed9aa8f259 compiler: Move int size/alignment functions to std.Target and std.zig.target.
This allows using them in e.g. compiler-rt.
2025-04-11 05:22:00 -04:00
Alex Rønne Petersen
0132be7bf3 std.Target: Rename charSignedness() to cCharSignedness().
To be consistent with the other functions that answer C ABI questions.
2025-04-11 05:22:00 -04:00
Jacob Young
c82e1fe880
Merge pull request #23355 from jacobly0/x86_64-rewrite
x86_64: start rewriting overflow operations
2025-04-11 05:21:44 -04:00
Alex Rønne Petersen
01b5e8b296
std: Disable some vector-related tests for hexagon.
See:

* https://github.com/llvm/llvm-project/issues/118879
* https://github.com/llvm/llvm-project/issues/134659
2025-04-11 02:28:35 +02:00
Alex Rønne Petersen
0a5c088ecc
compiler: Add hexagon-linux-musl support.
Closes #21588.
2025-04-11 02:28:35 +02:00
Alex Rønne Petersen
71a237e764
std.zig.system: Force soft_float feature on for MIPS soft float targets.
Workaround for: https://github.com/llvm/llvm-project/issues/135283
2025-04-11 02:08:18 +02:00
Pat Tullmann
4b63f94b4e Fix sigaddset/sigdelset bit-fiddling math
The code was using u32 and usize interchangably, which doesn't work on
64-bit systems.  This:
  `pub const sigset_t = [1024 / 32]u32;`
is not consistent with this:
  `const shift = @as(u5, @intCast(s & (usize_bits - 1)));`

However, normal signal numbers are less than 31, so the bad math doesn't matter much.  Also, despite support for 1024 signals in the set, only setting signals between 1 and NSIG (which is mostly 65, but sometimes 128) is defined.  The existing tests only exercised signal numbers in the first 31 bits so they didn't trip over this:

The C library `sigaddset` will return `EINVAL` if given an out of bounds signal number.  I made the Zig code just silently ignore any out of bounds signal numbers.

Moved all the `sigset` related declarations next to each in the source, too.

The `filled_sigset` seems non-standard to me.  I think it is meant to be used like `empty_sigset`, but it only contains 31 set signals, which seems wrong (should be 64 or 128, aka `NSIG`).  It's also unused.  The oddly named but similar `all_mask` is used (by posix.zig) but sets all 1024 bits (which I understood to be undefined behavior but seems to work just fine).  For comparison the musl `sigfillset` fills in 65 bits or 128 bits.
2025-04-10 23:49:44 +02:00
Jacob Young
06eebafadd AstGen: redistribute inline asm limits 2025-04-10 06:04:09 -04:00
Pat Tullmann
991560fb49 linux.zig: epoll_wait: pass kernel sigset size
Linux kernel syscalls expect to be given the number of bits of sigset that
they're built for, not the full 1024-bit sigsets that glibc supports.

I audited the other syscalls in here that use `sigset_t` and they're all
using `NSIG / 8`.

Fixes #12715
2025-04-09 16:37:58 +02:00
Manlio Perillo
f4e3631655 std.zon.parse: Fix typo in test "std.zon parse bool"
Replace "Correct floats" with "Correct bools".
2025-04-09 14:43:12 +02:00
Meghan Denny
70437354c0 std: add nvidia as a known arm implementer 2025-04-09 10:14:42 +02:00
imreallybadatnames™️
7733b5dbe6
Merge pull request #23501 from imreallybadatnames/master
Step.Compile: use LtoMode enum for lto option
2025-04-09 05:16:36 +00:00
Alex Rønne Petersen
9bbac42886
Merge pull request #23478 from alexrp/bsd-versions
`std.Target`: Bump some minimum OS versions for BSDs
2025-04-08 18:27:39 +02:00
Alex Rønne Petersen
2d33cc2e42
Merge pull request #23376 from sweiglbosker/m68k-archbits 2025-04-08 06:04:16 +02:00
Alex Rønne Petersen
1cab57f361
std.os.linux: Add some missing arch bits for loongarch64. 2025-04-07 16:03:22 +02:00
Alex Rønne Petersen
9423712519
std: Disable usage of fstat() and friends on loongarch.
Like riscv32, loongarch exclusively uses statx().
2025-04-07 16:03:22 +02:00
Stefan Weigl-Bosker
bcb4ba9afd
std.os.linux: use heap.pageSize() instead of MMAP2_UNIT 2025-04-07 13:37:01 +02:00
Stefan Weigl-Bosker
6fd358d287
std.os.linux: add arch bits for m68k
fixup
2025-04-07 13:36:45 +02:00
Alex Rønne Petersen
4b5941c54b
start: Reduce stack alignment for hexagon.
The ABI requires 8-byte alignment, not 16.
2025-04-07 13:09:10 +02:00
Alex Rønne Petersen
d3bf6c518f
start: Align the stack on m68k. 2025-04-07 13:09:10 +02:00
Stefan Weigl-Bosker
8fea9f68e8
start: fix pc register syntax for m68k 2025-04-07 13:09:10 +02:00
Alex Rønne Petersen
c8631ec523
std.Target: Bump minimum Dragonfly BSD version to 6.0.0. 2025-04-06 08:05:07 +02:00
Alex Rønne Petersen
af19161817
std.Target: Bump minimum OpenBSD version to 7.5.
Per: https://www.openbsd.org/faq/faq5.html#Flavors
2025-04-06 08:05:07 +02:00
Alex Rønne Petersen
a88db11c2a
std.Target: Bump minimum NetBSD version to 9.4.
Per: https://www.netbsd.org/releases
2025-04-06 08:05:07 +02:00
Alex Rønne Petersen
88e8e9fb91
std: Remove some FreeBSD version checks and resulting dead code.
We now require FreeBSD 13.4+.
2025-04-06 08:05:04 +02:00
Alex Rønne Petersen
ae98d79c87
std.Target: Bump minimum FreeBSD version to 13.4.
Per: https://www.freebsd.org/releases
2025-04-06 07:44:38 +02:00
Dacheng Gao
596e0bd47b std.os.linux: add constants for ETH 2025-04-06 02:52:20 +02:00
homersimpsons
95fdbc579f pow: fix typo 0 instead of inf 2025-04-05 21:20:10 +02:00
Andrew Kelley
0cd31fc7ff
Merge pull request #22780 from ziglang/llvm20
LLVM 20
2025-04-05 01:46:13 -04:00
Andrew Kelley
8acedfd5ba
Merge pull request #23459 from ziglang/linked-lists
de-genericify linked lists
2025-04-04 17:48:06 -04:00
Carmen
84c9cee502 fix review 2025-04-04 12:42:28 +01:00
Carmen
65c943671e OpenMode is exhaustive 2025-04-04 12:42:28 +01:00
Carmen
a61678b754 dont return tuple, split into 2 functions 2025-04-04 12:42:28 +01:00
Carmen
45afde2036 Payload -> @FieldType and use mem.sliceTo 2025-04-04 12:42:28 +01:00
Carmen
2112167f8c std.os.uefi.protocol.File: fix some typed definitions 2025-04-04 12:42:28 +01:00
Zenomat
8a83fc7eba
std.net: Implement if_nametoindex for windows (#22555) 2025-04-04 11:40:44 +00:00
Alex Rønne Petersen
33103071a7
std: Disable link with relative paths and linkat with different directories tests for mips64(el).
These started failing with LLVM 20 for unclear reasons:

test-std
└─ run test std-mips64-linux.4.19...6.13.4-gnuabi64.2.28-mips64r2-Debug-libc 2798/2878 passed, 2 failed, 78 skipped
error: 'posix.test.test.link with relative paths' failed: expected 2, found 0
/home/alexrp/Source/ziglang/zig-llvm20/lib/std/testing.zig:103:17: 0x1d9e5bf in expectEqualInner__anon_47031 (test)
                return error.TestExpectedEqual;
                ^
/home/alexrp/Source/ziglang/zig-llvm20/lib/std/posix/test.zig:311:9: 0x3650f57 in test.link with relative paths (test)
        try testing.expectEqual(@as(@TypeOf(nstat.nlink), 2), nstat.nlink);
        ^
error: 'posix.test.test.linkat with different directories' failed: expected 2, found 0
/home/alexrp/Source/ziglang/zig-llvm20/lib/std/testing.zig:103:17: 0x1d9e5bf in expectEqualInner__anon_47031 (test)
                return error.TestExpectedEqual;
                ^
/home/alexrp/Source/ziglang/zig-llvm20/lib/std/posix/test.zig:355:9: 0x3653377 in test.linkat with different directories (test)
        try testing.expectEqual(@as(@TypeOf(nstat.nlink), 2), nstat.nlink);
        ^
error: while executing test 'zig.system.darwin.macos.test.detect', the following test command failed:
qemu-mips64 -L /opt/glibc/mips64-linux-gnu-n64 /home/alexrp/Source/ziglang/zig-llvm20/.zig-cache/o/22a8c3762ea56ae3a674fa9ad15f6657/test --seed=0xa1dbb43c --cache-dir=/home/alexrp/Source/ziglang/zig-llvm20/.zig-cache --listen=-

test-std
└─ run test std-mips64-linux.4.19...6.13.4-gnuabi64.2.28-mips64r2-Debug-libc 2798/2878 passed, 1 failed, 79 skipped
error: 'posix.test.test.linkat with different directories' failed: expected 2, found 0
/home/alexrp/Source/ziglang/zig-llvm20/lib/std/testing.zig:103:17: 0x1d9e22f in expectEqualInner__anon_47031 (test)
                return error.TestExpectedEqual;
                ^
/home/alexrp/Source/ziglang/zig-llvm20/lib/std/posix/test.zig:356:9: 0x3650b47 in test.linkat with different directories (test)
        try testing.expectEqual(@as(@TypeOf(nstat.nlink), 2), nstat.nlink);
        ^
error: while executing test 'zig.system.darwin.macos.test.detect', the following test command failed:
qemu-mips64 -L /opt/glibc/mips64-linux-gnu-n64 /home/alexrp/Source/ziglang/zig-llvm20/.zig-cache/o/22a8c3762ea56ae3a674fa9ad15f6657/test --seed=0xa1dbb43c --cache-dir=/home/alexrp/Source/ziglang/zig-llvm20/.zig-cache --listen=-

Unfortunately, neither GDB nor LLDB want to play nice with qemu-mips64(el) at
the moment, so I can't easily debug these failures.
2025-04-04 06:08:10 +02:00
Alex Rønne Petersen
8954e9748a
std.Target: Add Abi.muslf32 and Abi.muslsf. 2025-04-04 06:08:09 +02:00
Alex Rønne Petersen
1599f8ade0
std.Target: Bump baseline hexagon model to hexagonv68.
https://github.com/llvm/llvm-project/pull/125584
2025-04-04 06:08:09 +02:00
Alex Rønne Petersen
eefb334885
std.Target: Bump baseline bpfel/bpfeb model to v3.
https://github.com/llvm/llvm-project/pull/131691
2025-04-04 06:08:09 +02:00
Alex Rønne Petersen
4de368a1b6
std.Target: Update CPU models/features for LLVM 20.
Closes #21818.
2025-04-04 06:08:09 +02:00
Andrew Kelley
337e1109f5 std.DoublyLinkedList: remove length tracking
this is trivial to tack on, and in my experience it is rarely wanted.
2025-04-03 15:57:35 -07:00
Andrew Kelley
3b77a845f9 de-genericify DoublyLinkedList
by making it always intrusive, we make it more broadly useful API, and
avoid binary bloat.
2025-04-03 15:35:21 -07:00
Andrew Kelley
1639fcea43 de-genericify SinglyLinkedList
by making it always intrusive, we make it a more broadly useful API, and
avoid binary bloat.
2025-04-03 14:55:04 -07:00
Alex Rønne Petersen
e9220525e8
Merge pull request #23447 from alexrp/cpuid-updates 2025-04-03 12:26:27 +02:00
Alex Rønne Petersen
bfbf4badd5
Merge pull request #23445 from alexrp/external-executor-fixes 2025-04-03 05:22:37 +02:00
Alex Rønne Petersen
e87387ee0c
std.zig.system.arm: Update some of the CPU lists based on LLVM 19. 2025-04-03 04:00:32 +02:00
Alex Rønne Petersen
8ff104380d
std.os.windows.PF: Add ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE. 2025-04-03 04:00:30 +02:00
Alex Rønne Petersen
9909465c1c
std.zig.system.darwin.macos: Handle tahiti/tupai in detectNativeCpuAndFeatures(). 2025-04-03 02:42:20 +02:00