31963 Commits

Author SHA1 Message Date
Alex Rønne Petersen
181330bbd4
zig cc: Remove headers related to GPU offload. 2024-12-16 04:36:57 +01:00
Alex Rønne Petersen
5f34224b2b
zig cc: Remove broken CUDA C/C++ support. 2024-12-15 05:45:53 +01:00
Alex Rønne Petersen
af89bb05d3
Merge pull request #22224 from alexrp/cc-args
`Compilation`: Clean up `addCCArgs()` + some minor improvements
2024-12-15 04:53:24 +01:00
Alex Rønne Petersen
d5c2f527b4
Merge pull request #22219 from alexrp/arm-big-endian
Add `armeb-linux-*`, `thumbeb-linux-*`, and `aarch64_be-linux-*` to CI
2024-12-15 01:41:46 +01:00
Alex Rønne Petersen
ee47094a33 Move fetch-them-macos-headers tools to ziglang/zig. 2024-12-14 23:45:18 +01:00
David Rubin
09a8fa2120 ensure InstMap capacity before remapping error code 2024-12-14 16:41:17 -05:00
Techatrix
cc82620b2a fix std.zig.Ast.rootDecls on .zon mode Ast 2024-12-14 16:40:40 -05:00
Andrew Kelley
13a28345bb
Merge pull request #22222 from ianprime0509/git-sha256
zig fetch: add support for SHA-256 Git repositories
2024-12-14 16:34:47 -05:00
Frank Denis
0fac47cf28
argon2: bail out if m < 8p (#22232)
Fixes #22231
2024-12-14 19:26:55 +00:00
Alex Rønne Petersen
70de2f3a76
Merge pull request #22156 from alexrp/mingw-update
Update MinGW-w64 to dcd7fefc703fb4b12187235386900d34cc13fdc5
2024-12-14 11:30:35 +01:00
Alex Rønne Petersen
13a9bf8629
std.zig.target: Update isLibCLibName() for MinGW dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-14 07:02:14 +01:00
Alex Rønne Petersen
2c192f8882
mingw: Update sources list to dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-14 07:02:14 +01:00
Alex Rønne Petersen
45fff0a511
mingw: Update sources to dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-14 07:02:14 +01:00
Alex Rønne Petersen
87083e8e7e
mingw: Update headers to dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-14 07:02:12 +01:00
Alex Rønne Petersen
39c4efa2a7
Compilation: Clean up addCCArgs().
The goal of this commit is to get rid of some "unused command line argument"
warnings that Clang would give for various file types previously. This cleanup
also has the side effect of making the order of flags more understandable,
especially as it pertains to include paths.

Since a lot of code was shuffled around in this commit, I recommend reviewing
the old and new versions of the function side-by-side rather than trying to make
sense of the diff.
2024-12-14 06:49:45 +01:00
gbaraldi
10282eae64 Also export mach_timebase_info_data from darwin 2024-12-14 03:16:34 +01:00
Ian Johnson
5217da57fc zig fetch: support SHA-256 Git repositories
Closes #21888
2024-12-13 08:49:45 -05:00
Ian Johnson
62cc81a63a Remove copy of HashedWriter
It was added to the standard library in #18733.
2024-12-13 08:49:45 -05:00
Carl Åstholm
de3db8a1a6 Fix undefined behavior in package extraction code 2024-12-13 08:49:45 -05:00
Carl Åstholm
b352595aa2 Add compiler internals tests
There are several test decls inside `/src` that are not currently being
tested and have bitrotted as a result. This commit revives those tests
and adds the `test-compiler-internals` set of tests which tests
everything reachable from `/src/main.zig`.
2024-12-13 08:49:02 -05:00
David Rubin
82f35c5186 add branchHint to std.Random.float 2024-12-13 13:24:38 +01:00
Alex Rønne Petersen
d74e87aab1
Compilation: Use Clang dependency file for preprocessed assembly files. 2024-12-13 06:48:35 +01:00
Alex Rønne Petersen
12a289c1dd
Compilation: Use a better canonical file extension for header files. 2024-12-13 06:48:35 +01:00
Alex Rønne Petersen
88f324ebe7
Compilation: Override Clang's language type for header files.
Clang seems to treat them as linker input without this.
2024-12-13 06:48:32 +01:00
Alex Rønne Petersen
b6ece854c9
Compilation: Improve classification of various C/C++/Objective-C files. 2024-12-13 05:05:36 +01:00
Alex Rønne Petersen
ece7bd4b1c
update_mingw: Update blacklist to dcd7fefc703fb4b12187235386900d34cc13fdc5. 2024-12-13 03:59:08 +01:00
Alex Rønne Petersen
ca3614594a
update_mingw: Remove some leftover code.
See 4a2b23c2beb043c1e5368d3737893494d61d4060.
2024-12-13 03:59:07 +01:00
Michael Dusan
a68119f8f1 macos: vendored libc: bump to SDK 15.1 2024-12-13 03:55:54 +01:00
Alex Rønne Petersen
9aa4cf4f88
test: Add aarch64_be-linux-* to the module test matrix. 2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
fdc0ed92ce
test: Add thumbeb-linux-* to the module test matrix. 2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
df27298aef
test: Add armeb-linux-* to the module test matrix. 2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
1e61399537
test: Disable some vector behavior tests on armeb.
https://github.com/ziglang/zig/issues/22060
2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
499ad89b41
std: Disable some vector-related tests on armeb.
https://github.com/ziglang/zig/issues/22060
2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
620f69c3b4
compiler-rt: Disable __aeabi_drsub test on armeb.
https://github.com/ziglang/zig/issues/22061
2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
130f7c2ed8
Merge pull request #22035 from alexrp/unwind-fixes
Better unwind table support + unwind protection in `_start()` and `clone()`
2024-12-13 03:09:24 +01:00
Alex Rønne Petersen
d48611ba67
Merge pull request #22090 from alexrp/glibc-runtime-triples
Add `std.zig.target.glibcRuntimeTriple()` and use it in `std.Build.Step.Run` and `process_headers.zig`
2024-12-12 18:55:15 +01:00
Techatrix
3f7b3daaa0 AstGen: fix analysis when encountering discard of error capture 2024-12-11 18:51:10 -05:00
Nico Elbers
4a3800d78f std.ArrayHashMap fix eql documentation
In cf88cf2657d721c68055a284e8c498a18639f74c the eql function provided in
The context of ArrayHashMap was changed to also include the key index,
but this wasn't properly updated in the documentation.

Since a flat `usize` is unintuitive, I've tried to explain the function
of the parameter as best I can based on the original commit.

Finally, I didn't do an extensive search if this eql definition is
incorrectly stated anywhere outside of these 2 spots. But I somewhat
doubt an file outside of `array_hash_map` would
2024-12-11 15:21:56 -05:00
Andrew Kelley
3670910f20
Merge pull request #22202 from ziglang/Cache.hit
std.Build.Cache.hit: more discipline in error handling
2024-12-11 14:57:11 -05:00
Andrew Kelley
7ff42eff91 std.Build.Cache.hit: work around macOS kernel bug
The previous commit cast doubt upon the initial report about macOS
kernel behavior, identifying another reason that ENOENT could be
returned from file creation.

However, it is demonstrable that ENOENT can be returned for both cases:
1. create file race
2. handle refers to deleted directory

This commit re-introduces the workaround for the file creation race on
macOS however it does not unconditionally retry - it first tries again
with O_EXCL to disambiguate the error condition that has occurred.
2024-12-11 11:56:44 -08:00
Frank Denis
295c5a64f5
Reinstantiates AEGIS-MAC with the final construction (#22205)
This reverts commit c9d6f8b5058ba0df3bf281a3be3a3570c2219754.
2024-12-11 18:52:43 +01:00
Andrew Kelley
d37ee79535 std.Build.Cache.hit: more discipline in error handling
Previous commits

2b0929929d67e222ca6a9523a3a594ed456c4a51
4ea2f441df36cec61e1017f4d795d4037326c98c

had this text:

> There are no dir components, so you would think that this was
> unreachable, however we have observed on macOS two processes racing to
> do openat() with O_CREAT manifest in ENOENT.

This appears to have been a misunderstanding based on the issue
report #12138 and corresponding PR #12139 in which the steps to
reproduce removed the cache directory in a loop which also executed
detached Zig compiler processes.

There is no evidence for the macOS kernel bug however the ENOENT is
easily explained by the removal of the cache directory.

This commit reverts those commits, ultimately reporting the ENOENT as an
error rather than repeating the create file operation. However this
commit also adds an explicit error set to `std.Build.Cache.hit` as well
as changing the `failed_file_index` to a proper diagnostic field that
fully communicates what failed, leading to more informative error
messages on failure to check the cache.

The equivalent failure when occuring for AstGen performs a fatal process
kill, reasoning being that the compiler has an invariant of the cache
directory not being yanked out from underneath it while executing. This
could be made a more granular error in the future but I suspect such
thing is not valuable to pursue.

Related to #18340 but does not solve it.
2024-12-10 18:11:12 -08:00
Alex Rønne Petersen
c666ebb1f8
musl: Add unwinding protection in clone() implementations.
Whatever was in the frame pointer register prior to clone() will no longer be
valid in the child process, so zero it to protect FP-based unwinders. This is
just an extension of what was already done for i386 and x86_64. Only applied
to architectures where the _start() code also zeroes the frame pointer.
2024-12-11 00:10:17 +01:00
Alex Rønne Petersen
da018f9726
std.os.linux: Add unwinding protection in clone() implementations.
Whatever was in the frame pointer register prior to clone() will no longer be
valid in the child process, so zero it to protect FP-based unwinders. Similarly,
mark the link register as undefined to protect DWARF-based unwinders.

This is only zeroing the frame pointer(s) on Arm/Thumb because of an LLVM
assembler bug: https://github.com/llvm/llvm-project/issues/115891
2024-12-11 00:10:17 +01:00
Alex Rønne Petersen
7d00877076
start: Extend DWARF unwinding protection to more architectures.
The function is not marked .cantunwind for Arm/Thumb because of an LLVM
assembler bug: https://github.com/llvm/llvm-project/issues/115891
2024-12-11 00:10:17 +01:00
Alex Rønne Petersen
43b6bd4243
start: Zero the link and frame pointer registers on all architectures. 2024-12-11 00:10:17 +01:00
Alex Rønne Petersen
8af82621d7
compiler: Improve the handling of unwind table levels.
The goal here is to support both levels of unwind tables (sync and async) in
zig cc and zig build. Previously, the LLVM backend always used async tables
while zig cc was partially influenced by whatever was Clang's default.
2024-12-11 00:10:15 +01:00
Alex Rønne Petersen
0b67463b92
riscv64: Support the fp alias for register s0 in inline assembly. 2024-12-11 00:09:22 +01:00
saurabh
c172877b81
std.posix: map errno 6 (ENXIO) to error.NoDevice in write() (#22113)
Co-authored-by: Saurabh <saurabhm@proton.me>
2024-12-11 00:06:51 +01:00
Travis Lange
414fc3b207 fix unknown file extension with rmeta 2024-12-10 21:12:55 +01:00