Commit graph

32947 commits

Author SHA1 Message Date
Ali Cheraghi
181a89e728
build: add spirv to test matrix
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
2025-02-24 19:12:38 +01:00
Ali Cheraghi
a0eec9ce9e
spirv: replace some unreachables with compile errors 2025-02-24 19:12:33 +01:00
Alex Rønne Petersen
51b44be9cc
std.zig.target: Support new wiaguid library name for MinGW-w64. 2025-02-24 12:01:12 +01:00
Alex Rønne Petersen
8afe928b6e
mingw: Update MinGW-w64 sources to 3839e21b08807479a31d5a9764666f82ae2f0356. 2025-02-24 12:01:07 +01:00
Alex Rønne Petersen
ed10a5db58
mingw: Update MinGW-w64 headers to 3839e21b08807479a31d5a9764666f82ae2f0356. 2025-02-24 11:59:10 +01:00
Alex Rønne Petersen
2404e7f5d6
update_mingw: Add update logic for winpthreads files.
Also rename a few constants for clarity.
2025-02-24 11:58:18 +01:00
Alec Fessler
1cc388d526 stdlib: handle EEXIST in mmap with FIXED_NOREPLACE. Fixes #21475 2025-02-24 04:36:14 -05:00
Alex Rønne Petersen
ecc76348e6
Merge pull request #22154 from alexrp/disable-intrinsics
compiler: Implement `@disableIntrinsics()` builtin function.
2025-02-24 08:25:23 +01:00
Alex Rønne Petersen
76558f8c6b llvm: Fix C ABI integer promotion for loongarch64.
It appears to just be a 1:1 copy of riscv64, including the super weird sign
extension quirk for u32.

Contributes to #21671.
2025-02-24 06:07:05 +01:00
Linus Groh
68bd82d0cc std.posix: Handle USER_MAPPED_FILE in windows ftruncate() impl 2025-02-23 16:58:26 -05:00
Andrew Kelley
e47f340e23 std.Build.Step.ConfigHeader: follow deprecation policy 2025-02-23 12:45:35 -08:00
Andrew Kelley
86f35479d9
Merge pull request #22794 from cbilz/autoconf_at
std.Build.Step.ConfigHeader: Add support for Autoconf-style `@FOO@` variables
2025-02-23 15:36:49 -05:00
Linus Groh
c44f4501e7 std.math.big.int: Support strings up to base 36
Co-Authored-By: samy007 <samy2014@free.fr>
2025-02-23 11:25:35 +00:00
mlugg
5e20e9b449 Sema: allow @ptrCast of slices changing the length
Also, refactor `Sema.ptrCastFull` to not be a horrifying hellscape.
2025-02-23 08:28:58 +00:00
Andrew Kelley
d6f8200294 zig fmt 2025-02-22 22:21:24 -08:00
Constantin Bilz
75b0538688 std.Build: Allow ConfigHeader values to be added at build.zig runtime 2025-02-22 23:31:17 -05:00
Anders Bondehagen
77007445bf
std.net: Fix IPv6 address format compression for long zero runs (#22441) 2025-02-22 19:52:47 -08:00
Jacob Young
220f80e71d Dwarf: fix lowering of comptime-only optional pointer null values
Closes #22974
2025-02-22 22:47:32 -05:00
Linus Groh
4b0f77cc1f std.crypto.tlcsprng: Fix hardcoded use of defaultRandomSeed()
Instead of hardcoding a call to defaultRandomSeed() use the customizable
std.options.cryptoRandomSeed() like in the rest of the function.

Closes #19943.
2025-02-22 22:39:40 -05:00
David Rubin
84aac8b6c7 Type: resolve union tag type before checking for runtime bits 2025-02-22 22:22:55 -05:00
Alex Rønne Petersen
e11ac02662
cbe: Implement support for -fno-builtin and @disableIntrinsics(). 2025-02-23 04:08:58 +01:00
Alex Rønne Petersen
6ba785584a
compiler: Implement @disableIntrinsics() builtin function.
Closes #21833.
Closes #22110.
2025-02-23 04:08:56 +01:00
Ryan Liptak
a502301b5e zig rc: Add COFF object file creation for CMake cross-compilation use case
In #22522 I said:

> RC="zig rc" will now work in combination with zig cc and CMake. Here's an example of cross-compiling a simple Windows GUI CMake project
>
>    $ RC="zig rc" CC="zig cc --target=x86_64-windows-gnu" cmake .. -DCMAKE_SYSTEM_NAME=Windows -G Ninja

However, I didn't realize that the time that this only works because of the `-G Ninja` part. When not using Ninja as the build tool, CMake adds a workaround for 'very long lists of object files' where it takes all object files and runs them through `ar` to combine them into one archive:

4a11fd8dde/Modules/Platform/Windows-GNU.cmake (L141-L158)

This is a problem for the Windows resource use-case, because `ar` doesn't know how to deal with `.res` files and so this object combining step fails with:

    unknown file type: foo.rc.res

Only the linker knows what to do with .res files (since it has its own `.res` -> `.obj` ('cvtres') conversion mechanism). So, when using Ninja, this object file combining step is skipped and the .res file gets passed to the linker and everyone is happy.

Note: When CMake thinks that its using `windres` as the Windows resource compiler, it will pass `-O coff` to windres which causes it to output a COFF object file instead of a `.res` file, which means that the `ar` step can succeed because it's only working on actual object files.

---

This commit gives `zig rc` the ability to output COFF object files directly when `/:output-format coff` is provided as an argument. This effectively matches what happens when CMake uses `windres` for resource compilation, but requires the argument to be provided explicitly.

So, after this change, the following CMake cross-compilation use case will work, even when not using Ninja as the generator:

    RC="zig rc /:output-format coff" CC="zig cc --target=x86_64-windows-gnu" cmake .. -DCMAKE_SYSTEM_NAME=Windows
2025-02-22 21:21:30 -05:00
Andrew Kelley
8683f25d24 std.heap.DebugAllocator: default wasm to 64K page size
including on freestanding
2025-02-22 21:06:00 -05:00
Andrew Kelley
dd54c48aa2 std.crypto.asn1: fix merge conflicts 2025-02-22 17:44:11 -08:00
Andrew Kelley
ed7004a2ee
Merge pull request #19976 from clickingbuttons/asn1
std.crypto: Add ASN1 module with OIDs and DER
2025-02-22 20:21:09 -05:00
Andrew Kelley
6769806213
Merge pull request #21727 from 87flowers/fmt-render2
std/zig/render: Rewrite indentation
2025-02-22 20:10:16 -05:00
Andrew Kelley
eb3c7f5706 zig build fmt 2025-02-22 17:09:20 -08:00
Andrew Kelley
c0c911bfa7 zig fmt: fix invalid alignment on frees 2025-02-22 17:09:20 -08:00
Andrew Kelley
ed55b2ef17 update to new pop API 2025-02-22 17:09:20 -08:00
87flowers
8469a44c9c std/http/Client: Remove TODO comments on indentation 2025-02-22 17:09:20 -08:00
87flowers
87172ee4e6 std/zig/render: Add doc comments to AutoIndentingStream 2025-02-22 17:09:20 -08:00
87flowers
fdf68c2f2e std/zig/parser: Add indentation tests 2025-02-22 17:09:20 -08:00
87flowers
c724e157d6 std/zig/render: implement fixes for unit tests 2025-02-22 17:09:20 -08:00
87flowers
a702dc31cc std/zig/render: assigns are .after_equals 2025-02-22 17:09:20 -08:00
87flowers
855445f18e arch/sparc64/CodeGen: Fix indentation in realStackOffset 2025-02-22 17:09:20 -08:00
87flowers
6013b53702 std/zig/render: Collapse one level of indentation in binop after equals sign 2025-02-22 17:09:20 -08:00
87flowers
9b2677c639 std/zig/render: Implement space mode to fix comment indentation 2025-02-22 17:09:20 -08:00
87flowers
ec3e4cc14b std/zig/render: Initial implementation of indentation 2025-02-22 17:09:20 -08:00
87flowers
1b0584fd02 std/zig/render: Implement AutoIndentingStream.init 2025-02-22 17:09:19 -08:00
mlugg
b6a1fdd3fa tests: disable failing tests
These were previously incremental tests, so weren't running. They didn't
*need* to be incremental. They worked under the old runner because of
how it directly integrated with the compiler so tracked error messages
differently.
2025-02-23 00:52:50 +00:00
mlugg
a3b3a33d7a cases: remove old incremental case system
We now run incremental tests with `tools/incr-check.zig` (with the
actual cases being in `test/incremental/`).
2025-02-23 00:52:50 +00:00
Alex Rønne Petersen
5e203e157b
Merge pull request #22903 from alexrp/llvm-nobuiltin-memcpy-inline
`llvm`: Use inline variants of `memcpy`/`memset` intrinsics when using `-fno-builtin`
2025-02-23 00:51:40 +01:00
Andrew Kelley
813312f0e8
Merge pull request #22714 from mlugg/langref
langref improvements
2025-02-22 18:41:35 -05:00
Pavel Verigo
b25d93e7d9 stage2-wasm: implement switch_dispatch + handle > 32 bit integers in switches
Updated solution is future proof for arbitary size integer handling for both strategies .br_table lowering if switch case is dense, .br_if base jump table if values are too sparse.
2025-02-22 18:34:00 -05:00
Andrew Kelley
61b69a418d
Merge pull request #22659 from ifreund/linker-script-fix
link: fix ambiguous names in linker scripts
2025-02-22 18:18:24 -05:00
geemili
6ef2384c07 std.DynLib: add support for DT_GNU_HASH sections in elf files 2025-02-22 17:33:49 -05:00
Chris Covington
b7512c3e5d
Add rapidhash (#22085) 2025-02-22 14:32:48 -08:00
Wyatt Radkiewicz
33ffbb32c9
std.zig.system.NativePaths: Add Homebrew paths (#22738) 2025-02-22 14:22:54 -08:00
David Rubin
36fc2d2607 AstGen: make layout specifiers on opaque containers a compile error 2025-02-22 17:21:34 -05:00