32969 Commits

Author SHA1 Message Date
Jonathan Gautheron
18b821666e
std.zig.c_translation: fix function pointer casting 2025-03-18 04:58:03 +01:00
mlugg
6c690a966a
Sema: correctly handle empty by-ref initializers
Resolves: #23210
2025-03-18 04:57:57 +01:00
Loris Cro
f954950485
std.Build.Watch: fix macos implementation
The code did one useless thing and two wrong things:

- ref counting was basically a noop
- last_dir_fd was chosen from the wrong index and also under the wrong
  condition

This caused regular crashes on macOS which are now gone.
2025-03-18 04:57:31 +01:00
Elijah M. Immer
f79dacbfc4
lib/std/http/Client.zig: Ignore empty proxy environment variables (#23223)
This fixes #21032 by ignoring proxy environment variables that are
empty.
2025-03-14 21:20:55 +01:00
TCROC
dc75a64c46
glibc: fix uninitialized memory in __pthread_cond_s for <=2.40
* https://sourceware.org/bugzilla/show_bug.cgi?id=32786
* https://inbox.sourceware.org/libc-alpha/87zfhpfqsm.fsf@oldenburg.str.redhat.com
2025-03-14 21:19:17 +01:00
mlugg
fdc9326868 Zcu: rename skip_analysis_errors to skip_analysis_this_update and respect it
On updates with failed files, we should refrain from doing any semantic
analysis, or even touching codegen/link. That way, incremental
compilation state is untouched for when the user fixes the AstGen
errors.

Resolves: #23205
2025-03-12 12:25:50 -07:00
mlugg
af4b39395c std.mem.Allocator.remap: fix incorrect doc comment (part 2) 2025-03-12 12:25:32 -07:00
孙冰
99b5a4f294 std.c: fix sysconf names (std.c._SC) for android api
c.f. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/sysconf.h
2025-03-12 12:25:20 -07:00
Andrew Kelley
22b7d02282 Merge pull request #23188 from jacobly0/fix-23143
x86_64: fix crashes with symbols
2025-03-12 12:25:05 -07:00
mlugg
623d5cc7f6 Sema: fix handling of @This() on opaques
Resolves: #22869
2025-03-11 11:21:03 -07:00
Mathias Lafeldt
ba97b1a2a2 Merge pull request #23193 from mlafeldt/fix-macho-detection
Fetch: enhance Mach-O executable detection for modern Macs

closes #21044
2025-03-11 11:20:55 -07:00
mlugg
72775adcd0 std.mem.Allocator.remap: fix incorrect doc comment
Resolves: #23194
2025-03-11 11:20:46 -07:00
Andrew Kelley
372d56371f Merge pull request #21933 from kcbanner/comptime_nan_comparison
Fix float vector comparisons with signed zero and NaN, add test coverage
2025-03-09 12:07:47 -07:00
Alex Rønne Petersen
6d44a8cd0b std.Target.Query: Don't append glibc version in zigTriple() if ABI isn't GNU. 2025-03-09 12:07:34 -07:00
Andrew Kelley
71e2f653cf Reapply "build: Don't check parent directories for git tag"
This reverts commit 7e0c25eccd8d9bc5b77953dbc9a39a26e383c550.

The `--git-dir` argument is relative to the `-C` argument, making this
patch OK after all.

I added a comment to go along with this since I found it confusing.

Apologies for the revert.
2025-03-09 12:06:59 -07:00
Ian Johnson
2ef72f84ca Sema: handle generated tag enums in union field order check
Fixes #23059

The "note: enum field here" now references the field in the base union type rather than crashing.
2025-03-08 11:29:56 -08:00
Jacob Young
8b9c517515 compiler-rt: fix signed min int from float 2025-03-08 11:22:46 -08:00
Alex Rønne Petersen
1a7ffe4aae Compilation: Fix -fno-rtlib-defaultlib unused argument warning in ReleaseSafe.
Closes #23138.
2025-03-08 11:22:38 -08:00
Alex Rønne Petersen
c9c58ebbe3
test: Disable test-elf-ld-script-path-error for now.
https://github.com/ziglang/zig/issues/23125
2025-03-08 07:07:49 +01:00
Alex Rønne Petersen
ed583e5466
zig cc: Don't pass -mabi for assembly files when targeting arm.
Clang's integrated Arm assembler doesn't understand -mabi yet, so this results
in "unused command line argument" warnings when building musl code and glibc
stubs, for example.
2025-03-08 04:13:20 +01:00
Andrew Kelley
8e91862571 fix InstallArtifact opening empty string
this appears to have been a problem since 43f73af3595c3174b8e67e9f2792c3774f2192e9
2025-03-07 13:34:13 -08:00
Andrew Kelley
61a95ab662 start the 0.14.1 release cycle 2025-03-05 12:42:08 -08:00
Andrew Kelley
5ad91a646a Release 0.14.0 0.14.0 2025-03-04 14:31:02 -08:00
Alex Rønne Petersen
3c924abb69 std.zig.llvm.bitcode_writer: Fix word byte order on big endian systems.
The bitcode format always uses little endian words. Prior to this commit, a
bitcode file produced on e.g. aarch64_be or s390x would fail to be loaded by
LLVM.
2025-03-04 17:28:03 -05:00
Carl Åstholm
8363b95178 Fix "dependency path outside project" error for nested local path dependencies
Closes #23076
2025-03-04 17:27:21 -05:00
Carl Åstholm
711b0fef58 init: Substitute invalid package names with foo
Closes #23066
2025-03-04 02:42:00 -05:00
Andrew Kelley
13757aacc7 update .mailmap
keeps our contributor count in the release notes somewhat accurate
2025-03-03 17:19:09 -08:00
Andrew Kelley
1e2b3b1df9 std.Build.Step: fix missing path sep in error message
I have a more robust solution to this coming up in the writer interface
branch.
2025-03-03 17:18:18 -08:00
Matthew Lugg
c76f451abc
Merge pull request #22979 from mlugg/remove-legacy-coercions
Sema: remove legacy coercion
2025-03-03 22:18:28 +00:00
mlugg
501e84a96a incremental: invalidate namespace dependencies when a name changes visibility
We could have more fine-grained dependencies here, but I think this is
fine for now.
2025-03-03 22:18:02 +00:00
Fausto Ribeiro
edabcf6192 std.DynLib: fix proper type of chain_ptr on GnuHashSection32
Type is correct on GnuHashSection64 but not on 32 bit version. Change it so
use of DynLib on 32-bit archs compiles.
2025-03-03 20:01:05 +01:00
Alex Rønne Petersen
4fad60fd3a compiler: Don't consider powerpc to have red zone support yet.
The command line flag is only supported in Clang 20: https://github.com/ziglang/zig/issues/23056

This gets rid of some warnings when using zig cc.
2025-03-03 19:36:46 +01:00
Linus Groh
6d29ef0baf
Merge pull request #23046 from linusg/uefi-time
Three time-related fixes for UEFI
2025-03-03 10:07:41 +00:00
Jacob Young
00a8742bbf
Merge pull request #22982 from mlugg/cache-mode
compiler: default to `.whole` cache mode for self-hosted backends
2025-03-02 22:15:42 -05:00
Linus Groh
3bea47883a std.time: Make Instant.since() work on UEFI 2025-03-02 23:16:34 +00:00
Linus Groh
1a03b8c899 std.os.uefi: Fix two padding mistakes in the Time struct
```c
//************************************************
//EFI_TIME
//************************************************
// This represents the current time information
typedef struct {
   UINT16    Year;              // 1900 - 9999
   UINT8     Month;             // 1 - 12
   UINT8     Day;               // 1 - 31
   UINT8     Hour;              // 0 - 23
   UINT8     Minute;            // 0 - 59
   UINT8     Second;            // 0 - 59
   UINT8     Pad1;
   UINT32    Nanosecond;        // 0 - 999,999,999
   INT16     TimeZone;          // —1440 to 1440 or 2047
   UINT8     Daylight;
   UINT8     Pad2;
 }   EFI_TIME;
```
2025-03-02 23:16:34 +00:00
Linus Groh
6378295b77 std.os.uefi: Fix integer overflow in Time.toEpoch()
Instead of thinking hard about what the actual supported maximum value
for each sub-calculation is we can simply use an u64 from hours onwards.
2025-03-02 22:58:45 +00:00
Jacob Young
d741be512b link: fixed bugs uncovered by changing the cache mode 2025-03-02 16:39:18 -05:00
mlugg
725c825829 link: make sure MachO closes the damn files
Windows is a ridiculous operating system designed by toddlers, and so
requires us to close all file handles in the `tmp/xxxxxxx` cache dir
before renaming it into `o/xxxxxxx`. We have a hack in place to handle
this for the main output file, but the MachO linker also outputs a file
with debug symbols, and we weren't closing it! This led to a fuckton of
CI failures when we enabled `.whole` cache mode by default for
self-hosted backends.

thanks jacob for figuring this out while i sat there
2025-03-02 16:39:18 -05:00
mlugg
c2983a3f88 compiler: default to .whole cache mode for self-hosted backends
This is a better default cache mode until incremental compilation is
enabled by default.
2025-03-02 16:39:18 -05:00
rpkak
0367d684fc add parentheses in std.heap.page_size_min 2025-03-02 22:27:57 +01:00
Frank Denis
d8d2aa9af4
crypto.pcurves.common: generalize invert() (#23039)
The Bernstein-Yang inversion code was meant to be used only with the
fields we currently use for the NIST curves.

But people copied that code and were confused that it didn't work as
expected with other field sizes.

It doesn't cost anything to make it work with other field sizes,
that may support in the future. So let's do it.
This also reduces the diff with the example zig code in fiat crypto.

Suggested by @Rexicon226 -- Thank you!
2025-03-02 11:27:04 +01:00
Jacob Young
a6525c1762
Merge pull request #22529 from xtexx/x86-64/shl-sat-int
x86_64: Implement integer saturating left shifting codegen
2025-03-02 02:51:36 -05:00
Bingwu Zhang
1da909a1e2
x86_64: add behavior tests for saturating shift left
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Signed-off-by: Bingwu Zhang <xtex@aosc.io>
2025-03-02 10:30:43 +08:00
xtex
4e32193de3
x86_64: implement integer saturating left shifting codegen
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: #17645
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Signed-off-by: Bingwu Zhang <xtex@aosc.io>
2025-03-02 10:30:32 +08:00
Andrew Kelley
235001a646 zig init template: remove outdated comments
closes #23040
2025-03-01 16:11:59 -08:00
Jacob Young
50b40c9621 x86_64: rewrite wrapping add/sub 2025-03-01 16:29:22 -05:00
Andrew Kelley
6c3cbb0c87
Merge pull request #22994 from ziglang/newhash
implement new package hash format: `$name-$semver-$hash`
2025-02-28 04:40:05 -05:00
Andrew Kelley
6b6c1b1b0e Revert "Merge pull request #22898 from kristoff-it/deprecated-proposal"
This reverts commit dea72d15da4fba909dc3ccb2e9dc5286372ac023, reversing
changes made to ab381933c87bcc744058d25a876cfdc0d23fc674.

The changeset does not work as advertised and does not have sufficient
test coverage.

Reopens #22822
2025-02-28 01:37:10 -08:00
Alex Rønne Petersen
5c44934e20 Move the compiler's LLVM bitcode builder to std.zig.llvm. 2025-02-27 01:32:49 -05:00