Commit Graph

15129 Commits

Author SHA1 Message Date
Andrew Kelley 04481c76cb Merge pull request 'Export wrapper around Zig DllMain function when linking libc + add tests' (#32179) from squeek502/zig:windows-dlls into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32179
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-05-02 20:06:56 +02:00
Ryan Liptak 8b16160b6f DllMain symbols: use ptrCast to allow using non-std pointer type
`HINSTANCE` is `*opaque {}` so using a type that should be compatible from alternate bindings (zigwin32, for example) would be a (false positive) compile error without this ptrCast.
2026-05-02 02:44:26 -07:00
Ryan Liptak 5aeeb6a0a4 Conditionally export wrapper around Zig-defined DllMain function when linking libc
This logic exists for other main functions, so it makes sense to do it for DllMain, too.
2026-05-02 02:44:26 -07:00
Andrew Kelley 0db721ec2e std: alias lang to builtin
see #19690
2026-05-02 11:29:27 +02:00
Saurabh Mishra d02d0b879c std:ArrayList: Merge getLastOrNull into getLast (#32008)
This PR merges the functionality of the `getLastOrNull` method into `getLast`, which improves consistency as its
based on methods like `front`, `back`, and `peek` in the `Deque` and `PriorityQueue` containers.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32008
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-05-02 02:26:15 +02:00
Andrew Kelley 95507faf13 llvm builder: add missing comma before predictable metadata 2026-05-01 06:31:38 +02:00
Meghan Denny 7c39558c7c std.MultiArrayList: add a swap method 2026-05-01 06:31:11 +02:00
squidy239 1e9bae83f1 remove deprecated managed MemoryPool versions (#31483)
`MemoryPoolOptions` becomes `memory_pool.Options`

`Managed`, `AlignedManaged`, and `ExtraManaged` removed

progresses #31220

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31483
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-05-01 05:27:45 +02:00
Alex Rønne Petersen dfbea20d45 zig std: don't return an error exit code on --help 2026-05-01 00:53:39 +02:00
Matthew Lugg 72d954e7d3 compiler: remove array multiplication from the language
Resolves: https://github.com/ziglang/zig/issues/24738
2026-04-30 09:03:58 +01:00
Matthew Lugg fdac89d6cd remove uses of array multiplication
In preparation for its removal as accepted in
https://github.com/ziglang/zig/issues/24738.
2026-04-30 08:57:51 +01:00
Matthew Lugg 57634b7809 compiler: remove i0 from the language
Resolves: https://github.com/ziglang/zig/issues/1593
2026-04-30 08:57:51 +01:00
Matthew Lugg 213c4fc25f lib,test: remove uses of i0
In preparation for its removal, as accepted in
https://github.com/ziglang/zig/issues/1593.
2026-04-30 08:57:51 +01:00
Matthew Lugg d764716cb5 compiler: remove capturing errdefer from the language
Resolves: https://github.com/ziglang/zig/issues/23734
2026-04-30 08:57:50 +01:00
Matthew Lugg ce198b7c28 std.c: fix Haiku definition of MSF 2026-04-28 12:52:03 +01:00
mihael 764760df62 libzigc/math: Implement rintl, lrintl (#31791)
It's a fairly straightforward port of `musl`'s `rintl`, like `rint` and `rintf` were. `libc-test` tests for `rintl` are uncommented since they're now passing.

I've also covered special cases for `rint` with tests, and broke down the current `rint` and `modf` test declarations into multiple -- so each libc function get its own test declaration at the very least.

Contributes to #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31791
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-27 16:48:55 +02:00
GasInfinity 1deb029a66 std: rename bit_set variants and deprecate the managed one.
* aliases and deprecates the previous names.
* also update callsites to use the non-deprecated declarations.
2026-04-27 16:46:26 +02:00
Alex Rønne Petersen dde76ae5f7 libunwind: unregress x32 and mips n32 build
https://github.com/llvm/llvm-project/issues/194228
2026-04-27 10:16:02 +02:00
Alex Rønne Petersen 19fd87fff1 std.http.test: update issue link for powerpc64 LLVM crash
https://github.com/llvm/llvm-project/issues/194257
2026-04-26 21:46:14 +02:00
Alex Rønne Petersen 4eb9db0b24 std: re-enable some tests on loongarch64 2026-04-26 21:22:34 +02:00
Alex Rønne Petersen fc56124fac std: re-enable some tests on s390x
closes https://github.com/ziglang/zig/issues/25957
2026-04-26 21:22:31 +02:00
Alex Rønne Petersen c47c05386e llvm-libc: update to LLVM 22 2026-04-26 19:26:16 +02:00
Alex Rønne Petersen 9f2f6aaef5 drop support for powerpc64-linux-gnu
glibc has never officially supported ELFv2 on big-endian PowerPC, and we do not
(and likely never will) support linking ELFv1. So just drop this target instead
of pretending we actually have anything resembling usable support for it. This
is a dying target anyway; IBM have been pushing people to powerpc64le for years
now, and most distros have dropped big endian.

glibc headers and abilists are not updated as part of this; I'll just let that
happen automatically on the next glibc update. Size savings are expected to be
very minimal anyway since there's large overlap between powerpc64 and
powerpc64le.

This commit also fixes a couple of bad assumptions in std.Target:

* The dynamic linker path should be /lib64/ld64.so.1. We should get this right
  even if the Zig compiler doesn't support the target.
* cCallingConvention() was picking powerpc64_elf_v2 only for musl targets. In
  reality, for the targets we support in std.Target, it should pick v2 for all
  except powerpc64-linux-gnu.

Finally, this switches LLVM codegen to use ELFv2 data layout for all targets
except ps3.
2026-04-26 19:24:46 +02:00
Alex Rønne Petersen 814988647f libcxxabi: unregress arm-freebsd and arm-openbsd build
https://github.com/llvm/llvm-project/issues/194232

Regression known for at least 2 months, but hey, just ship it anyway.
2026-04-26 15:42:05 +02:00
Alex Rønne Petersen a83aad152b Merge pull request 'LLVM 22' (#32013) from llvm22 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32013
2026-04-26 07:03:38 +02:00
Andrew Kelley e7d74e49b0 declare linker test bankruptcy
The active contributors and maintainers of Zig's linker code have
generally found the current linker test harness to be cumbersome. The
tests require a lot of maintenance, but do not provide a lot of
coverage, and when they fail it is painful to troubleshoot.

Furthermore, as part of working on #31691, I don't want to port over the
CheckObject step, because I don't like the code anyway.

The plan forward is to start enhancing `zig objdump` to assist in
linker development, as well as using it as the basis for snapshot
testing.

We absolutely need linker test coverage, but we need to try to improve
these things about the next attempt:
* less effort to create and maintain tests
* less CPU overhead - we should be able to add a lot of tests without
  adding a lot of CI time.
* more helpful failures. A failed linker test should provide the next
  steps a developer can take to understand why the test failed.
* a goal of porting over all of LLD's test suite, or at least the good
  ones.

I'm not going to open an issue to track the lost linker test coverage,
because there was already so much lack of coverage for linker stuff.

However I will open issues to track this lost coverage:
* the deleted checks from test/standalone/glibc_compat/build.zig
* the deleted checks from test/standalone/compiler_rt_panic/build.zig
* the deleted checks from test/standalone/ios/build.zig
2026-04-26 00:15:07 +02:00
Alex Rønne Petersen bd12a5a6e1 std: re-enable a bunch of tests that now pass
closes https://github.com/ziglang/zig/issues/21893
closes https://github.com/ziglang/zig/issues/23806
closes https://github.com/ziglang/zig/issues/23807
closes https://github.com/ziglang/zig/issues/24191
closes https://codeberg.org/ziglang/zig/issues/30220
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 7829397f89 Revert "std.zig.system: disable vector support on s390x for now"
This reverts commit 1cd913a0ec.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 061c13f13b Revert "std.mem: work around LoongArch inline asm bug in doNotOptimizeAway()"
This reverts commit e7f1624e6e.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 51a6a5a2a6 Revert "std.math.modf: disable vector test on LoongArch with LSX"
This reverts commit 35d2b1e99a.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 8eb8034af9 Revert "std.zig.system: Force soft_float feature on for MIPS soft float targets."
This reverts commit 71a237e764.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen cb2cb21b31 std.zig.system.x86: improve AVX10 detection 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 13c6e227a9 std.zig.system.x86: require OS APX save support for APX features 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 44004b05ef std.zig.system.x86: detect more APX features 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen c46a8e0d2c std.zig.system.x86: detect Diamonds Rapids, Wildcat Lake, and Nova Lake 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen a24eee8390 std.zig.system.x86: fix prefetchi detection on AMD 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 6880b5678a std.zig.system.arm: add detection for a bunch more cores 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen eb041a514f std.zig.system.windows: update aarch64 CPU feature detection 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 7c3d4642ae std.os.windows: update PF feature flags from winnt.h 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 1be84a39b8 compiler: fix and simplify DllMainCRTStartup handling
See: https://github.com/llvm/llvm-project/pull/171680
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 593f45ee02 llvm: switch most targets to using half and fp128 IR types
As of LLVM 22, most backends can (finally) handle legalization of these types as
necessary, so we don't need to do it ourselves anymore.

closes https://github.com/ziglang/zig/issues/23674
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen 9e1e54d324 compiler-rt: additionally export __trunctfhf2 as __trunckfhf2 on powerpc
This is the name LLVM 22 expects.
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen ca0b3318a0 std.Target: update CPU and feature data to LLVM 22 2026-04-25 21:54:47 +02:00
Alex Rønne Petersen c855c61432 libtsan: backport llvm/llvm-project#194116
https://github.com/llvm/llvm-project/pull/194116
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen f3bd49a5d8 libtsan: backport llvm/llvm-project#183411
https://github.com/llvm/llvm-project/pull/183411
2026-04-25 21:49:39 +02:00
Alex Rønne Petersen dbaea8d67e libtsan: update to LLVM 22 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen e79b4e907a libunwind: update to LLVM 22 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen dfabf1586f libcxx: update to LLVM 22 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 80212b03ff libcxxabi: update to LLVM 22 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 520af69660 zig cc: update intrinsic headers to LLVM 22 2026-04-25 21:49:39 +02:00