11206 Commits

Author SHA1 Message Date
Alex Rønne Petersen
ba37a4369b std.zig.WindowsSdk: Support cross-arch SDK lookups.
This makes e.g. cross-compiling for x86-windows-msvc on a x86_64-windows-msvc
system work properly.

Closes #11926.
2024-12-08 04:53:28 +01:00
Alex Rønne Petersen
4894ac4bcb
Merge pull request #22130 from alexrp/zig-h-portability
Some portability improvements and cleanups in `zig.h`
2024-12-07 12:11:57 +01:00
Andrew Kelley
eb9c9a38f2
Merge pull request #22167 from alexrp/compiler-rt-names
compiler: Classify various compiler-rt and libunwind names accurately and satisfy them
2024-12-06 19:04:39 -05:00
Alex Rønne Petersen
ca069244b2 std.Target: Fix charSignedness() for hexagon. 2024-12-06 18:15:29 +01:00
Alex Rønne Petersen
65cfc91836
std.zig.target: Consider libsupc++ to be a libc++ library name.
This is, roughly, GCC's equivalent of libc++abi.
2024-12-06 15:08:43 +01:00
Alex Rønne Petersen
d70be200d8
Merge pull request #22141 from alexrp/target-remove-bridgeos
`std.Target`: Remove `Os.Tag.bridgeos`
2024-12-05 15:05:25 +01:00
Frank Denis
c9d6f8b505
Remove parallel variants of AEGIS-MAC (#22146)
The construction is likely to change before standardization
2024-12-04 22:45:07 +00:00
Alex Rønne Petersen
09b39f77b7
std.Target: Remove Os.Tag.bridgeos.
It doesn't appear that targeting bridgeOS is meaningfully supported by Apple.
Even LLVM/Clang appear to have incomplete support for it, suggesting that Apple
never bothered to upstream that support. So there's really no sense in us
pretending to support this.
2024-12-03 20:43:15 +01:00
Alex Rønne Petersen
c27488a387
zig.h: Add zig_gnuc_asm macro to indicate availability of GNU-style inline asm. 2024-12-03 12:11:05 +01:00
Alex Rønne Petersen
f058b147d3
zig.h: Introduce operating system macros. 2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
084ec97811
zig.h: Introduce object format macros. 2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
ace8396076
zig.h: Move some macros and includes closer to where they're used. 2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
0e934c7df1
zig.h: Use C99/C11 headers if available regardless of language standard.
If present, these headers are usable even when compiling for older C language
versions.

Most notably, this enables zig.h atomics to work with slimcc and TinyCC in C99
mode (and earlier).
2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
1c43c2c209
zig.h: Remove duplicate and unguarded stdint.h include.
We already do this for C99 only later in the file.
2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
125bf05c27
zig.h: Implement zig_unreachable() with __assume(0) for MSVC. 2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
062feb6c82
zig.h: Implement zig_frame_address() with _AddressOfReturnAddress() for MSVC. 2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
37538f19cd
zig.h: Use zig_*_windows_teb() inline assembly with TinyCC and slimcc. 2024-12-03 12:07:34 +01:00
Alex Rønne Petersen
204df19d79
zig.h: Avoid depending on cpuid.h for zig_x86_cpuid().
Just use inline assembly instead, which is what that header does. Also make sure
we have a dummy implementation when inline assembly is unavailable.
2024-12-03 12:07:32 +01:00
Alex Rønne Petersen
24b57f4d30
zig.h: Introduce architecture macros to simplify checks throughout. 2024-12-03 11:57:21 +01:00
Alex Rønne Petersen
ba66814185
zig.h: Don't use __debugbreak() for MinGW.
It seems like only Clang supports this in MinGW mode, and Clang will already
take the __builtin_debugtrap() path anyway.
2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
d19e1919da
zig.h: Define zig_gnuc for both GCC and Clang and stop using __GNUC__.
There's only one spot in the header where we want to handle GCC but not Clang,
so just add an extra check there.
2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
dd1d9cce3c
zig.h: Add a zig_msvc macro to be used instead of _MSC_VER. 2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
f29daebd90
zig.h: Use __thread for slimcc in pre-C11 mode. 2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
fa6946f645
zig.h: Add support for C23 keywords.
The old spellings from C11 are deprecated in C23.
2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
023a7fefb1
zig.h: Add TinyCC support where appropriate.
tcc doesn't have __has_attribute and __has_builtin, so we need to manually check
for tcc in these preprocessor paths.
2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
43a1b88bc8
zig.h: Use __BYTE_ORDER__ instead of __LITTLE_ENDIAN__ for endianness check.
The former is supported by most compilers while the latter is Clang-only.
2024-12-03 11:57:20 +01:00
Alex Rønne Petersen
14c79203c4
std.os.linux: Fix fadvise64 syscall selection for n32/x32. 2024-12-01 02:23:55 +01:00
Andrew Kelley
8d8801c96d
Merge pull request #19968 from wooster0/eql
std.mem.eql: make comparisons for zero-sized and non-sized types work
2024-11-29 16:19:39 -05:00
Pat Tullmann
5e1a83ad29 defaultPanic: @trap on 'other' target
The freestanding and other OS targets by default need to just @trap in the
default Panic implementation.

And `isValidMemory` won't work with freestanding or other targets.

Update the unwind_freestanding.zig test case to also run on the 'other' OS
target, too.  This should keep the Zig's stacktrace generation from
regressing on the standalone targets.
2024-11-29 15:30:05 -05:00
Andrew Kelley
a47aa9dd9d
Merge pull request #22095 from alexrp/test-llvm-emit
Change `llvm_targets` tests to actually emit objects, and fix bugs found as a result
2024-11-29 15:28:54 -05:00
Rohan Vashisht
88d57917b7
Updated ascii.zig's isWhitespace function to use switch instead of for loop. (#22094) 2024-11-29 12:26:23 -08:00
Jay Petacat
97b8d662e6 std.Build: Detect pkg-config names with "lib" prefix 2024-11-29 15:11:14 -05:00
Alex Rønne Petersen
4a73b8cbb3 std.builtin: Add VaListXtensa. 2024-11-28 23:31:11 +01:00
Alex Rønne Petersen
7fe219998f
std.Target: Fix long double alignment for wasm(32,64)-emscripten-*. 2024-11-28 21:31:28 +01:00
Alex Rønne Petersen
6cd67cec67
std.Target: Fix long double size for aarch64-bridgeos-*. 2024-11-28 21:31:28 +01:00
Alex Rønne Petersen
310d1c1ff4
std.Target: Fix long/unsigned long size for aarch64-watchos-ilp32. 2024-11-28 21:31:28 +01:00
Alex Rønne Petersen
aea4f705dc
std.Target: Add missing C type info for aix, elfiamcu, hermit, hurd, rtems, and zos. 2024-11-28 21:31:28 +01:00
Andrew Kelley
182cdf74bf
Merge pull request #22087 from ziglang/std.ArrayHashMap
std.ArrayHashMap: add `reinit` method and other housekeeping, including the move towards "unmanaged" containers
2024-11-28 14:07:30 -05:00
Alex Rønne Petersen
8594f179f9
Merge pull request #22067 from alexrp/pie-tests
Add PIC/PIE tests and fix some bugs + some improvements to the test harness
2024-11-28 14:07:28 +01:00
Andrew Kelley
e374483d67 std.ArrayHashMap: update to the "gpa"/"arena" convention
for Allocator names
2024-11-27 14:35:01 -08:00
Andrew Kelley
20215a376c prepare to remove the "Managed" variant of std.ArrayHashMap 2024-11-27 14:34:27 -08:00
Andrew Kelley
da6e80c30a std.ArrayHashMap: explicit error sets 2024-11-27 14:34:26 -08:00
Andrew Kelley
c9c7ede2f9 introduce std.ArrayHashMap.reinit 2024-11-27 14:34:08 -08:00
Alex Rønne Petersen
6cf01a679f std.Thread.Futex: Mark inline asm volatile in WasmImpl.
Closes #22082.
2024-11-27 23:24:37 +01:00
Justin Braben
d16a9b0acb
std.os.windows: Map PIPE_NOT_AVAILABLE from OpenFile() to error.NoDevice (#21938) 2024-11-27 22:33:29 +01:00
mlugg
1a99c99ee9 std.Build: gracefully handle child stdin closing when running tests
We have deduced that it seems the sporadic BrokenPipe failures happening
on the CI runners (e.g.
https://github.com/ziglang/zig/actions/runs/12035916948/job/33555963190)
are likely caused by the test runner's stdin pipe abnormally closing,
likely due to the process crashing. Here, we introduce error handling
for this case, so that if these writes fail, the step is marked as
failed correctly, and we still collect the child's stderr to report.
This won't fix the CI issues, but it should promote them to proper error
messages including child stderr, which -- at least in theory -- should
allow us to ultimately track down where the errors come from.

Note that this change is desirable regardless of bugs in the test runner
or similar, since the child process could terminate abnormally for any
number of reasons (e.g. a crashing test), and such cases should be
correctly reported by the build runner.
2024-11-27 19:35:31 +00:00
Andrew Kelley
11bf2d92de diversify "unable to spawn" failure messages
to help understand where a spurious failure is occurring
2024-11-26 13:56:40 -08:00
Andrew Kelley
68b3f50866
Merge pull request #22070 from Rexicon226/fix-crc32
add `crc32` as a feature dep of `sse4.2` and refactor `update_cpu_feature.zig`
2024-11-26 16:29:51 -05:00
Alex Rønne Petersen
047311a76a std.math: Disable isSignalNan test on mips32.
https://github.com/ziglang/zig/issues/14366
2024-11-26 18:29:13 +01:00
Chris Boesch
87863a834b
std.math.complex: Add squared magnitude function (#21998) 2024-11-26 13:03:48 +00:00