Commit Graph

17061 Commits

Author SHA1 Message Date
Alex Rønne Petersen
bc7cdc2b6b libcxxabi: don't build cxa_noexception.cpp if exceptions are enabled 2025-10-06 23:28:58 +02:00
Alex Rønne Petersen
03078bfa41 libcxxabi: sort file list according to upstream CMakeLists.txt 2025-10-06 23:28:52 +02:00
Alex Rønne Petersen
b2591d50c7 libcxxabi: define _LIBCPP_BUILDING_LIBRARY in addition to _LIBCXXABI_BUILDING_LIBRARY 2025-10-06 23:28:39 +02:00
xdBronch
cfb5350ed4 don't pass zero-length @memset to the backend 2025-10-06 23:26:05 +02:00
Jacob Young
7de67e6802 InternPool: use sequential string indices instead of byte offsets
This allows more bytes to be referenced by a smaller index range.

Closes #22867
Closes #25297
Closes #25339
2025-10-05 00:27:39 -04:00
Jacob Young
2700af2aeb x86_64: fix bool vector init register clobber
Closes #25439
2025-10-03 23:26:21 -04:00
mlugg
e6e93d82b0 Lld: fix implib emit path
Resolves: https://github.com/ziglang/zig/issues/24993
2025-10-02 10:55:16 +02:00
Jacob
ab6dbfe1a3 translate_c: fix ternary operator output in C macros 2025-10-01 14:23:54 +02:00
Timothy Bess
0795e2b2ef Fix zig build lazy -> eager dependency promotion
Before, this had a subtle ordering bug where duplicate
deps that are specified as both lazy and eager in different
parts of the dependency tree end up not getting fetched
depending on the ordering. I modified it to resubmit lazy
deps that were promoted to eager for fetching so that it will
be around for the builds that expect it to be eager downstream
of this.
2025-10-01 04:36:15 +02:00
Alex Rønne Petersen
4fd78f9c26 libcxx: respond to some feature macro changes in LLVM 20
ba87515fea

closes #25376
2025-09-28 15:31:22 +02:00
Andrew Kelley
135f1915da Compilation: --debug-rt always Debug
--debug-rt previously would make rt libs match the root module. Now they
are always debug when --debug-rt is passed. This includes compiler-rt,
fuzzer lib, and others.
2025-09-28 08:19:39 +02:00
Ryan Liptak
c40dbd6ff0 Update descriptions of -f[no-]error-tracing to match the actual behavior
Before https://github.com/ziglang/zig/pull/18160, error tracing defaulted to true in ReleaseSafe, but that is no longer the case. These option descriptions were never updating accordingly.
2025-09-28 08:18:45 +02:00
Alex Rønne Petersen
6b1d94c539 musl: add missing fenv C dummy functions for loongarch64-linux-muslsf
https://www.openwall.com/lists/musl/2025/09/27/1

closes #25367
2025-09-28 08:18:18 +02:00
Alex Rønne Petersen
a1c410d512 Revert "x86_64: improve support for large enums"
This reverts commit 8520e4e286.
2025-09-26 00:19:47 +02:00
Jacob Young
8520e4e286 x86_64: improve support for large enums
Closes #25247
2025-09-25 07:44:58 +02:00
Jacob Young
a430be097b x86_64: support more in/out forms
Closes #25303
2025-09-25 01:11:05 +02:00
alexrp
e526d65f5e compiler: don't use self-hosted backend on any BSD yet
There are some blocking bugs in the self-hosted ELF linker.
2025-09-24 01:11:42 +02:00
Alex Rønne Petersen
9694c83b95 Revert "frontend: another packedStructFieldPtrInfo fix"
This reverts commit 3ab845e028.
2025-09-22 04:56:46 +02:00
Alex Rønne Petersen
d07b67a55c Revert "x86_64: fix safety crashes in storeRegs"
This reverts commit 37985613c7.
2025-09-21 21:42:39 +02:00
Jacob Young
e647d1a570 x86_64: rewrite vector element pointer access 2025-09-21 21:36:23 +02:00
Jacob Young
80eacd6003 aarch64: fix behavior failures 2025-09-21 21:08:52 +02:00
Frank Denis
798acd932e aarch64/zonCast: don't return a pointer to a stack element
Elements are computed at comptime, so don't declare them as "var".
2025-09-21 21:08:52 +02:00
Andrew Kelley
3da6a19011 x86 codegen: handle spilled tuples 2025-09-21 21:08:52 +02:00
Jacob Young
37985613c7 x86_64: fix safety crashes in storeRegs 2025-09-21 21:08:52 +02:00
Andrew Kelley
670c4fae61 frontend: additionally handle C pointers in ptrOptPayload 2025-09-21 21:08:52 +02:00
Andrew Kelley
4d102751b6 frontend: fix too strict assertion
field ptr can be based on C pointer
2025-09-21 21:08:52 +02:00
Andrew Kelley
3ab845e028 frontend: another packedStructFieldPtrInfo fix
it was calculating host integer size in a wrong way. just use integer
abi size
2025-09-21 21:08:52 +02:00
mlugg
b4394412bb Zcu: fix analysis of type of decl with inferred type
If the `nav_ty` is resolved by the `nav_val`, then we need to also mark
the `nav_ty` as in progress when we begin resolving the `nav_val`.
2025-09-21 21:08:51 +02:00
Frank Denis
c15f8b9fc9 Fix duplicate LC_RPATH entries on macOS Tahoe
When building on macOS Tahoe, binaries were getting duplicate LC_RPATH
load commands which caused dyld to refuse to run them with a
"duplicate LC_RPATH" error that has become a hard error.

The duplicates occurred when library directories were being added
to rpath_list twice:

- from lib_directories
- from native system paths detection which includes the same dirs
2025-09-19 16:39:56 +02:00
Frank Denis
7d8a954578 zig fmt help: mention that the argument can be a directory
I’ve been typing `zig fmt **/.zig` for a long time, until I discovered
that the argument can actually be a directory.

Mention this feature explicitly in the help message.
2025-09-19 12:12:49 +02:00
Andrew Kelley
35de86906d Merge pull request #25201 from jacobly0/x86_64-addsat
x86_64: fix strictness edge cases in `+|`
2025-09-18 12:47:18 +02:00
Jacob Young
b8bf2780a0 Elf: implement linksection
Closes #24330
2025-09-18 12:47:18 +02:00
Silver
e14540399c fix handling of comptime-only union fields in Type.getUnionLayout (#25182)
Fixes #25180
2025-09-18 12:47:17 +02:00
mlugg
87ca304a02 llvm: fix tagged union payload size in debug info
Resolves: #24415
2025-09-18 00:01:28 +01:00
mlugg
4cfb58342a frontend: fix reference tracking through coerced function bodies
This bug was manifesting for user as a nasty link error because they
were calling their application's main entry point as a coerced function,
which essentially broke reference tracking for the entire ZCU, causing
exported symbols to silently not get exported.

I've been a little unsure about how coerced functions should interact
with the unit graph before, but the solution is actually really obvious
now: they shouldn't! `Sema` is now responsible for unwrapping
possibly-coerced functions *before* queuing analysis or marking unit
references. This makes the reference graph optimal (there are no
redundant edges representing coerced versions of the same function) and
simplifies logic elsewhere at the expense of just a few lines in Sema.
2025-09-15 11:29:54 +01:00
Ryan Liptak
76e2764eb1 Fix -M and --dep splitting on every = instead of just the first
Before this commit, -Mfoo=bar=baz would be incorrectly split into mod_name: `foo` and root_src_orig: `bar`
After this commit, -Mfoo=bar=baz will be correctly split into mod_name: `foo` and root_src_orig: `bar=baz`

Closes #25059
2025-09-02 22:35:01 +02:00
Andrew Kelley
61f4475233 LLVM backend:fix align 1 sret parameter load returned
closes #25067
2025-09-02 22:30:48 +02:00
Jacob Young
49f0122e41 x86_64: fix multiplication overflow detection with adx
Closes #24965
2025-08-28 05:30:04 +02:00
Alex Rønne Petersen
b2578329af zig cc: don't pass -mcmodel for assembly files
It does nothing but generate a warning for these.
2025-08-26 00:11:27 +02:00
Arnau Camprubí
17928ef58b Add test-obj to the help message 2025-08-25 18:51:20 +02:00
Alex Rønne Petersen
48600bc2b3 Compilation: avoid ZCU strategy for ubsan-rt in Windows DLLs 2025-08-25 18:51:09 +02:00
Andrew Kelley
001ec07772 Merge pull request #24249 from antlilja/dwarf-extern-arg
Fix compiler crash when passing a comptime extern function arg to a function
2025-08-18 13:25:13 -07:00
mlugg
c1483eb05c Compilation: fix compiler_rt and ubsan_rt strategy logic
It doesn't really make sense for `target_util.canBuildLibCompilerRt`
(and its ubsan-rt friend) to take in `use_llvm`, because the caller
doesn't control that: they're just going to queue a sub-compilation for
the runtime. The only exception to that is the ZCU strategy, where we
effectively embed `_ = @import("compiler_rt")` into the Zig compilation:
there, the question does matter. Rather than trying to do multiple weird
calls to model this, just have `canBuildLibCompilerRt` return not just a
boolean, but also differentiate the self-hosted backend being capable of
building the library vs only LLVM being capable. Logic in `Compilation`
uses that difference to decide whether to use the ZCU strategy, and also
to disable the library if the compiler does not support LLVM and it is
required.

Also, remove a redundant check later on, when actually queuing jobs.
We've already checked that we can build `compiler_rt`, and
`compiler_rt_strat` is set accordingly. I'm guessing this was there to
work around a bug I saw in the old strategy assignment, where support
was ignored in some cases.

Resolves: #24623
2025-08-18 13:07:40 -07:00
Ali Cheraghi
2f422372b5 spirv: do not decorate nav alignment
they seem to be always `null` even when accessed through extern key so we have no way to tell whether they have natural alignment or not to decorate. And the reason we don't always decorate them is because some environments might be too dumb and crash for this.
2025-08-18 11:24:57 -07:00
Andrew Kelley
399bace2f2 Merge pull request #24874 from ziglang/tls-client
std: more reliable HTTP and TLS networking
2025-08-16 14:47:52 -07:00
Andrew Kelley
ef14c73245 Compilation: remove last instance of deprecatedReader
This also makes initStreaming preemptively disable file size checking.
2025-08-16 14:46:20 -07:00
mlugg
0096c0806c Compilation: retain ZCU object when emitting unstripped Mach-O binary
On macOS, when using the LLVM backend, the output binary retains a
reference to this object file's debug info (as opposed to self-hosted
backends which instead emit a dSYM bundle). As such, we need to retain
this object file in such cases. This object does unfortunately "leak",
in that it won't be reused and will just sit in the cache forever (or
until GC'd in the future). But that's no worse than the cache behavior
prior to the rework that caused this, and it will become less of a
problem over time as the self-hosted backend gains usability for debug
builds and eventually becomes the default.

Resolves: #24369
2025-08-16 21:56:24 +01:00
Andrew Kelley
07b753f22b Fetch: bump zstd decompression buffer
see #24735
2025-08-16 00:07:40 -07:00
Jacob Young
375bc2d7b5 Dwarf: implement comptime-known extern values
Closes #24259
2025-08-15 18:29:06 -04:00
mlugg
8ef82e8355 what if we kissed by the extern source bit 2025-08-15 18:23:40 -04:00