Jan200101
bf6ee7cb34
cmake: use cache entry for extra build args to get the type correct
2025-01-28 14:23:42 +01:00
Alex Rønne Petersen
aa37a5a0c4
zig.h: Add some casts to __atomic macros to shut Clang warnings up.
...
This is a stupid Clang-ism:
❯ cat test.c
int main() {
int value = 42;
int const *value_ptr = &value;
int location;
__atomic_store(&location, value_ptr, __ATOMIC_SEQ_CST);
}
❯ gcc test.c -fsyntax-only
❯ clang test.c -fsyntax-only
test.c:5:31: warning: passing 'const int *' to parameter of type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
5 | __atomic_store(&location, value_ptr, __ATOMIC_SEQ_CST);
| ^~~~~~~~~
1 warning generated.
I have no idea why Clang doesn't define these builtins as taking const pointers
for the parameters that are only read from. Anyway, after the next zig1.wasm
update, this change should shut up these warnings that we've been seeing in CI
during bootstrap for ages.
2025-01-28 13:01:35 +01:00
87
183bb8b084
langref: Document destructuring ( #21627 )
2025-01-28 04:23:13 +00:00
Alex Rønne Petersen
41e7604359
Merge pull request #22573 from sorairolake/fix-invisible-doccomments
...
Fix invisible doccomments at the start of source files to make them visible
2025-01-28 04:59:14 +01:00
Andrew Kelley
37037b269e
frontend: use main Compilation code_model when building libxx
...
as well as libtsan, libunwind, and libc files
2025-01-27 17:07:56 -08:00
John Benediktsson
884b1423a4
std.heap.memory_pool: make preheat() usable after init()
2025-01-28 00:06:54 +01:00
Andrew Kelley
eed3b9567d
Merge pull request #22610 from jacobly0/x86_64-rewrite
...
x86_64: rewrite `@min`/`@max` for scalar floats
2025-01-27 11:47:52 -08:00
Andrew Kelley
df1fa36feb
Revert "std.http.Server: add Request.getHeader() function ( #21625 )"
...
This reverts commit 21823d1b5d1ebfa27df954c2cef5d0f231fb8402.
It's a bad API that could easily lead to O(N^2) logic.
2025-01-27 11:13:56 -08:00
dbubel
21823d1b5d
std.http.Server: add Request.getHeader() function ( #21625 )
2025-01-27 17:58:05 +00:00
Carter Snook
2043e8ae05
main: classify empty environment variables as unset
...
This matches existing well-specified conventions for e.g. NO_COLOR.
Closes #22380 .
2025-01-27 17:53:32 +01:00
Alex Rønne Petersen
5647dd84c1
Revert d714cf33405486d9aa707e9aee8f103a011d06e9 ( #21273 )
...
Turns out this was already fixed in #21964 .
I have no idea why GitHub showed an incorrect diff in #21273 , or how applying the diff to master was even possible, but here we are.
2025-01-26 20:52:29 -08:00
Shun Sakai
7599216341
std.zip: Include the last paragraph in top-level doc comments
...
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-01-27 12:24:36 +09:00
isaac yonemoto
ae5b1a9ca2
langref: fixes incorrect description of cmpxchg functions
2025-01-26 23:22:04 +01:00
melonedo
658a4a527c
Fix incompatibility with multi-config cmake generator
...
Avoid hard coding the path of zig2 relative to PROJECT_BINARY_DIR
2025-01-26 21:06:09 +01:00
bsubei
3f245616a5
link to Tuples section in Hello World docs, and give an example of an empty tuple
2025-01-26 20:53:25 +01:00
rpkak
9c45fb4b09
langref: correct return type of comptime known bitcount ops
2025-01-26 20:30:06 +01:00
injuly
d714cf3340
std.c.darwin: Fix EXC.MASK compile error ( #21273 )
2025-01-26 19:56:14 +01:00
kj4tmp@gmail.com
6255ee3d2f
fix typo in @typeName langref
2025-01-26 19:40:57 +01:00
Will Lillis
672bc8141f
fix: Only suggest try on destructure of error union if payload type can be destructured ( #21510 )
2025-01-26 19:38:07 +01:00
Fri3dNstuff
9c6d728b0c
std.meta: handle comptime fields in hasUniqueRepresentation ( #22132 )
2025-01-26 18:23:34 +00:00
Eric Joldasov
3179961854
std.Build: add more explicit error sets to some functions
...
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2025-01-26 19:03:33 +01:00
ExeVirus
738d813619
Add zig std to langref.html ( #22360 )
2025-01-26 18:58:30 +01:00
thejohnny5
5b3eaff80d
std: check max depth for vector type in formatType
2025-01-26 18:53:11 +01:00
Enrique Miguel Mora Meza
24965af295
std.os.linux: Adding sigdelset ( #22406 )
2025-01-26 18:49:25 +01:00
Pierre Tachoire
df9fdb1861
std.net.listen: no REUSEPORT with unix socket
...
On Linux, set REUSEPORT option on an unix socket returns a EOPNOTSUPP error.
See 5b0af621c3
2025-01-26 18:40:34 +01:00
dweiller
df1cd62720
compiler-rt: ensure memcpy Element has no unused bytes
2025-01-26 07:00:24 -08:00
Jacob Young
654da648b3
x86_64: rewrite @min/@max for float vectors
2025-01-26 09:51:07 -05:00
Jacob Young
0c890bb9a4
x86_64: rewrite @min/@max for scalar floats
2025-01-26 06:58:37 -05:00
Meghan Denny
92b20e4216
stf: do not call xcode-select or xcrun by absolute path in darwin sdk detection
2025-01-26 09:07:39 +01:00
ziggoon
6a4986b2d6
Update LDR_DATA_TABLE_ENTRY struct
2025-01-26 03:40:17 +01:00
Matthew Lugg
3767b08039
Merge pull request #22602 from mlugg/incr-embedfile
...
incremental: handle `@embedFile`
2025-01-26 01:41:56 +00:00
Andrew Kelley
8fa47bb904
Merge pull request #22230 from alexrp/lto-stuff
...
Disable LTO by default + some LTO fixes
2025-01-25 13:17:25 -08:00
Alex Rønne Petersen
015a5e1982
std.Build: Make ofmt part of standardTargetOptions().
2025-01-25 20:39:10 +01:00
Andrew Kelley
d0d5ca2b6c
Merge pull request #22581 from jacobly0/x86_64-rewrite
...
x86_64: rewrite `@abs` on floats
2025-01-25 07:30:45 -08:00
Alex Rønne Petersen
b60e39fe8f
Compilation: Disable LTO by default.
...
LLD has too many LTO bugs, and we're dropping the LLD dependency soon anyway.
2025-01-25 14:59:02 +01:00
Alex Rønne Petersen
9f116d38b8
libtsan: Build with unwind tables like upstream.
2025-01-25 14:58:55 +01:00
Alex Rønne Petersen
46a1a15861
Compilation: Remove the _tls_index hack for MinGW.
...
No longer needed since we disable LTO for mingw32.
2025-01-25 14:58:44 +01:00
Alex Rønne Petersen
1e8b82f6b4
compiler: Rework LTO settings for some Zig-provided libraries.
...
* compiler-rt and mingw32 have both run into LLD bugs, and LLVM disables LTO for
its compiler-rt, so disable LTO for these.
* While we haven't run into any bugs in it, LLVM disables LTO for its libtsan,
so follow suit just to be safe.
* Allow LTO for libfuzzer as LLVM does.
2025-01-25 14:57:33 +01:00
Alex Rønne Petersen
afe2fed34d
link: Set machine and float ABI when invoking ld.lld and lld-link.
...
If this isn't done, LTO can completely miscompile the input bitcode modules for
certain targets where we need to explicitly set these ABIs (because LLVM's
defaults are bad).
2025-01-25 14:57:33 +01:00
Alex Rønne Petersen
cd8c92fc40
compiler: Explicitly specify ABI for arm, mips, and powerpc when talking to LLVM.
...
See 652c5151429e279f70396ee601416c87a70c1bec. Better to avoid relying on default
LLVM behavior going forward.
2025-01-25 14:56:59 +01:00
Alex Rønne Petersen
b95081209a
compiler: Explicitly specify loongarch ABI when talking to LLVM.
...
Necessary because of: dc665fa5f5
2025-01-25 14:56:59 +01:00
Alex Rønne Petersen
673544b783
compiler-rt: Pass called functions into inline asm so the compiler sees the usage.
2025-01-25 14:54:02 +01:00
Alex Rønne Petersen
35da1e1e8f
compiler-rt: Don't export __a(u)ll(div,rem) if linking libc.
...
libc provides these when targeting MSVC.
2025-01-25 13:49:21 +01:00
Alex Rønne Petersen
05a877a9a1
compiler-rt: More accurately export Windows Arm functions.
2025-01-25 13:49:21 +01:00
mlugg
fcf8d5ada2
incr-check: check compile errors against expected
...
Also modifies all incremental cases using `#expect_error` to include the
errors and notes which are expected.
2025-01-25 09:32:40 +00:00
mlugg
7ef345f342
incr-check: deal with Windows stupidity
...
The real problem here is that Git for Windows has horrendous defaults
which convert LF to CRLF. However, rather than changing this
configuration on the CI runners, it's worth supporting inexplicable CRLF
in these files so that anyone else cloning Zig on Windows doesn't get
unexpected test failures.
2025-01-25 08:57:20 +00:00
mlugg
f47b8de2ad
incremental: handle @embedFile
...
Uses of `@embedFile` register dependencies on the corresponding
`Zcu.EmbedFile`. At the start of every update, we iterate all embedded
files and update them if necessary, and invalidate the dependencies if
they changed.
In order to properly integrate with the lazy analysis model, failed
embed files are now reported by the `AnalUnit` which actually used
`@embedFile`; the filesystem error is stored in the `Zcu.EmbedFile`.
An incremental test is added covering incremental updates to embedded
files, and I have verified locally that dependency invalidation is
working correctly.
2025-01-25 06:07:08 +00:00
mlugg
5202c977d9
std: add fs.path.fmtJoin
...
This allows joining paths without allocating using a `Writer`.
2025-01-25 04:48:00 +00:00
Matthew Lugg
8ba3812eee
Merge pull request #22594 from mlugg/panic-stuff
...
compiler: yet more panic handler changes
2025-01-25 04:10:55 +00:00
Jacob Young
c7433212d1
x86_64: rewrite scalar and vector int @min and @max
2025-01-24 21:02:32 -05:00