Commit graph

33513 commits

Author SHA1 Message Date
Dimitris Dinodimos
155b34ba05 Change the lld path on macos homebrew
Homebrew now provides lld in a separate formula; it was part of llvm
formula.
2025-04-04 06:03:19 +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
Alex Rønne Petersen
b532f6c827
std.c.darwin.CPUFAMILY: Add ARM_TAHITI and ARM_TUPAI. 2025-04-03 02:41:44 +02:00
Alex Rønne Petersen
7289a073e5
std.zig.system.x86: Synchronize CPUID/XGETBV checks with LLVM 19.
Also fix a bunch of cases where we didn't toggle features off if the relevant
leaf isn't available, and switch XCR0 checks to a packed struct.

Closes #23385.
2025-04-03 02:29:26 +02:00
Alex Rønne Petersen
171cea74b6
std.zig.system: Make getExternalExecutor() allow Darling for driverkit. 2025-04-02 23:58:55 +02:00
Alex Rønne Petersen
c3f2222a59
std.zig.system: Make getExternalExecutor() less opinionated about Wasmtime.
Wasmtime supports both wasm32 and wasm64, and can run freestanding WASM binaries
just fine (although the usefulness of the latter is fairly limited).
2025-04-02 23:58:55 +02:00
Alex Rønne Petersen
11db7eaf4e
std.zig.system: Fix a check in getExternalExecutor() to use the host argument. 2025-04-02 23:58:54 +02:00
Alex Rønne Petersen
55ee88f9c0
std.zig.system: Fix wine executable name in getExternalExecutor().
I'm not actually aware of any distro where the name is wine64, so just use wine
in all cases. As part of this, I also fixed the architecture checks to match
reality.

Closes #23411.
2025-04-02 23:58:52 +02:00
Parker Liu
de62dc884e
translate-c: fix function prototype decalared inside a function
* If a function prototype is declarated inside a function, do not
  translate it to a top-level extern function declaration. Similar to
  extern local variable, just wrapped it into a block-local struct.

* Add a new extern_local_fn tag of aro_translate_c node for present
  extern local function declaration.

* When a function body has a C function prototype declaration, it adds
  an extern local function declaration. Subsequent function references
  will look for this function declaration.
2025-04-02 20:07:41 +00:00
Alex Rønne Petersen
9dfdf35032
Merge pull request #22337 from ruihe774/fix-app-mask
* std.os.linux: remove app_mask
* std.posix: on libc-less linux, block all signals in raise(), not just app_mask
2025-04-02 17:36:59 +02:00
Matthew Lugg
4303b43519
Merge pull request #22907 from MasonRemaley/import-zon-anon-type
Allow importing ZON without a result type (you can import build.zig.zon now)
2025-04-02 13:17:34 +01:00
Auguste Rame
bfab9582c7
DebugAllocator: Fix bucket removal logic causing segfault/leak (#23390)
Make buckets doubly linked
2025-04-02 12:15:04 +00:00
Matthew Lugg
896ffe6658
Merge pull request #22973 from MasonRemaley/zon-stop-on-node
Allow parsing into `Zoir.Node.Index` (it's easier to parse build.zig.zon at runtime now)
2025-04-02 12:00:23 +01:00
Misaki Kasumi
aa832d6a6d std.os.linux: block all signals in raise 2025-04-02 18:50:14 +08:00
Mason Remaley
fa1695a8b0
std.zon.parse: make ast and zoir fields of Diagnostics non-optional 2025-04-02 06:09:21 +01:00
Mason Remaley
65649576db
std.zon.parse: rename Status to Diagnostics
This name is more appropriate and in line with the rest of `std`.
2025-04-02 06:08:55 +01:00
Mason Remaley
3b2fec17a4
std.zon: populate Zoir.Node.Index values with corresponding ZOIR node
This allows using `std.zon` to parse schemas which are not directly
representable in the Zig type system; for instance, `build.zig.zon`.
2025-04-02 06:08:04 +01:00
mlugg
dd3f01eadf
incremental: add test for ZON file without result type 2025-04-02 05:58:29 +01:00
mlugg
d8ac37fcc8
stage1: fix wasi_snapshot_preview1_fd_seek on cache files
`wasm2c` uses an interesting mechanism to "fake" the existence of cache
directories. However, `wasi_snapshot_preview1_fd_seek` was not correctly
integrated with this system, so previously crashed when run on a file in
a cache directory due to trying to call `fseek` on a `FILE *` which was
`NULL`.
2025-04-02 05:57:50 +01:00
Mason Remaley
87209954a7
Zcu: fix ZOIR cache bugs
* When saving bigint limbs, we gave the iovec the wrong length, meaning
  bigint data (and the following string and compile error data) was corrupted.
* When updating a stale ZOIR cache, we failed to truncate the file, so
  just wrote more bytes onto the end of the stale cache.
2025-04-02 05:54:04 +01:00
Mason Remaley
06ee383da9
compiler: allow @import of ZON without a result type
In particular, this allows importing `build.zig.zon` at comptime.
2025-04-02 05:53:22 +01:00
David Rubin
1b62a22268 Sema: increment extra index even if return type is generic 2025-04-02 01:34:17 +02:00
Carmen
9720bade7a
std.start: allow return uefi error union in main (#23425) 2025-04-01 17:10:10 +00:00
Carmen
fa86e09fb3
std.os.uefi.protocol: ziggify function signatures (#23214) 2025-04-01 10:47:51 +00:00
Ali Cheraghi
b636d56d6a zon: normalize negative zeroes 2025-03-31 19:07:34 -04:00
Jacob Young
b431e9af97 Elf: fix incrementally reallocating the last atom in a section 2025-03-31 19:06:25 -04:00
mlugg
d53cc5e5b2 Sema: allow @ptrCast slice of zero-bit type to slice of non-zero-bit type
This is actually completely well-defined. The resulting slice always has
0 elements. The only disallowed case is casting *to* a slice of a
zero-bit type, because in that case, you cna't figure out how many
destination elements to use (and there's *no* valid destination length
if the source slice corresponds to more than 0 bits).
2025-03-31 19:03:08 -04:00
Parker Liu
0bdc0bb534
translate-c: fix referencing extern locals from nested blocks 2025-03-31 20:22:03 +03:00
Alex Rønne Petersen
0753af792a
Merge pull request #23371 from alexrp/ci-redundancy
Remove some `aarch64-linux` CI steps that are already covered by `x86_64-linux`
2025-03-31 17:51:25 +02:00
Alex Rønne Petersen
c118cd6406
Merge pull request #23417 from dweiller/zstd-fixes
Zstd fixes
2025-03-31 17:50:32 +02:00
Simon Brown
43ad87555e Add quota for comptime sort, add test 2025-03-31 17:47:46 +02:00
dweiller
d034f2a87b std.compress.zstd: ensure window size fits into usize 2025-03-31 17:22:44 +11:00
dweiller
7a7d6a02a5 std.compress.zstd: fix OOB access in literal decode
When decoding the literals section of a compressed block, the length of
the regenerated size of the literals must be checked against the buffer
literals are decoded into.
2025-03-31 17:22:44 +11:00
David Rubin
acfdad8581 Sema: convert slice sentinel to single pointer correctly 2025-03-30 03:41:00 +01:00
mlugg
f296eec294 Zcu: resolve layout of analyzed declaration type
Resolves: #19888
2025-03-29 22:46:31 +00:00
mlugg
eee752ea5a compiler: "illegal behavior", not "undefined behavior", in errors 2025-03-29 18:40:23 -04:00
Frank Denis
ca1fc3827e
crypto.ecdsa: fix EcdsaP384Sha3_384 constant name (#23403)
Spotted by @deatil -- Thanks!
2025-03-29 14:52:34 +00:00
Sean Stasiak
6e8493daa3 check result of mmap() call to handle a large base_addr value correctly 2025-03-27 20:34:41 +01:00
Alex Rønne Petersen
c85534a5c6 stage1: Update zig1.wasm.
Signed-off-by: Alex Rønne Petersen <alex@alexrp.com>
2025-03-27 17:43:05 +01:00
Alex Rønne Petersen
2b57f6b717
Merge pull request #23378 from alexrp/build-zig-cleanup 2025-03-27 17:12:17 +01:00
Alex Rønne Petersen
cc9634a2d3
Merge pull request #23373 from alexrp/get-base-address
`std.process`: Some minor fixes for `getBaseAddress()`
2025-03-27 15:39:24 +01:00
GalaxyShard
b5a5260546 std.Build: implement addEmbedPath for adding C #embed search directories 2025-03-27 09:47:42 +01:00
blurrycat
fb188c3d18
std.posix: add getuid()/geteuid() 2025-03-27 07:58:27 +00:00