13849 Commits

Author SHA1 Message Date
Andrew Kelley
4debd4338c
Merge pull request #18547 from ziglang/gh-fork-dump-fchmod-fixes
Add `fchmodat` fallback on Linux when `flags` is nonzero.
2024-01-14 11:26:25 -08:00
Krzysztof Wolicki
78549d1e10 mingw: Add missing misc/mingw-access.c and misc/ucrt-access.c 2024-01-14 11:25:01 -08:00
jimying
a30147c992 libcxx: only pass -DHAVE___CXA_THREAD_ATEXIT_IMPL for glibc >=2.18
this fix #9412
2024-01-13 23:17:33 -08:00
Krzysztof Wolicki
60d411184e autodoc: Rename Module (Compilation Module) to Zcu in preparation for big rename 2024-01-13 23:13:05 -08:00
Stephen Gregoratto
bc69d62669 Linux: Add fchmodat fallback when flags is nonzero
The check for determining whether to use the fallback code has been
moved into an inline function as per Andrew's comments in #17954.
2024-01-13 23:52:01 -07:00
Andrew Kelley
bd46410419 Revert "Merge pull request #18410 from dweiller/by-length-slice-bug"
This reverts commit d9d840a33ac8abb0e616de862f592821a7f4a35e, reversing
changes made to a04d4330945565b8d6f298ace993f6954c42d0f3.

This is not an adequate implementation of the missing safety check, as
evidenced by the changes to std.json that are reverted in this commit.

Reopens #18382
Closes #18510
2024-01-13 23:21:44 -07:00
Luuk de Gram
4f2009de12
Merge pull request #18528 from Luukdegram/wasm-linker-fixes
wasm-linker: Fix debug info
2024-01-13 08:42:33 +01:00
Meghan Denny
3d6c26525f sema: forbid asm output to const locals 2024-01-12 16:23:42 -08:00
Luuk de Gram
3f22bb96f3
wasm-linker: fix debug info relocation
This corrects calculating the offsets to the code section as we now
correctly allocate the code atoms during write taking the 'size' into
account. We also handle dead symbols which are garbage-collected by
writing -2 and -1 to skip ranges, loc and other sections respectively.
2024-01-12 14:57:37 +01:00
Luuk de Gram
7fe629a812
wasm-linker: delay code atom allocation till write
We delay atom allocation for the code section until we write the actual
atoms. We do this to ensure the offset of the atom also includes the
'size' field which is leb128-encoded and therefore variable. We need this
correct offset to ensure debug info works correctly.

The ordering of the code section is now automatic due to iterating the
function section and then finding the corresponding atom to each
function. This also ensures each function corresponds to the right atom,
and they do not go out-of-sync.

Lastly, we removed the `next` field as it is no longer required and also
removed manually setting the offset in synthetic functions. This means
atoms use less memory and synthetic functions are less prone. They will
also be placed in order of function order correctly.
2024-01-12 14:57:36 +01:00
Luuk de Gram
2b3e6f680c
wasm-linker: ensure custom sections are parsed
Not all custom sections are represented by a symbol, which means the
section will not be parsed by the lazy parsing and therefore get garbage-
collected. This is problematic as it may contain debug information that
should not be garbage-collected. To resolve this, we manually create
local symbols for those sections and also ensure they do not get garbage-
collected.
2024-01-12 14:57:32 +01:00
Andrew Kelley
30688c341b LLVM: fix lowering of extern anyopaque
closes #18461
2024-01-11 01:00:49 -08:00
Andrew Kelley
df6aed0fc3
Merge pull request #18505 from ziglang/tsan
TSAN: update to LLVM 17.0.6
2024-01-10 15:08:49 -08:00
february cozzocrea
aafff25897
translate-c: float cast from boolean expr fix 2024-01-10 19:13:11 +00:00
Andrew Kelley
71e7bef2a2 tsan: use explicit error set
Fixes fail to build from source when LLVM not linked.
2024-01-10 09:30:24 -08:00
Andrew Kelley
798c68d5a5 tsan: update build logic for tsan from llvm 17.0.6 2024-01-10 01:00:37 -07:00
Andrew Kelley
036e9fd479 libcxx: fix not passing any_sanitize_thread correctly 2024-01-10 00:51:18 -07:00
Andrew Kelley
3051d4390b Compilation: fix tsan error reporting 2024-01-10 00:51:02 -07:00
Bogdan Romanyuk
4a1a5ee47b
AstGen: add error for redundant comptime var in comptime scope (#18242) 2024-01-09 20:09:39 -05:00
Andrew Kelley
7320b24e0e
Merge pull request #18486 from castholm/undefined-version
Add support for `--(no-)undefined-version`
2024-01-09 14:23:31 -08:00
Andrew Kelley
acca16c8ce
Merge pull request #18173 from dweiller/switch-err-union
Special-case switching on error union capture
2024-01-09 13:54:27 -08:00
Joel Gustafson
dbdee2d53c
ignore charset and boundary directives in content-type headers when fetching dependencies 2024-01-09 20:16:59 +00:00
dhash
9bb6430318 Add support for --(no-)undefined-version
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Samuel Cantero <scanterog@gmail.com>
Co-authored-by: Giorgos Georgiou <giorgos.georgiou@datadoghq.com>
Co-authored-by: Carl Åstholm <carl@astholm.se>
2024-01-09 17:24:11 +01:00
Andrew Kelley
60094cc3fc
Merge pull request #18491 from ziglang/fix-mod-link-obj-path
std.Build.Step.Compile: fix link object paths
2024-01-09 01:11:15 -08:00
joachimschmidt557
f12ec02bd7 stage2 AArch64: get empty file compiling again 2024-01-08 23:53:24 -08:00
dweiller
67d7d7b5a7 fixup! astgen: use switch_block_err_union 2024-01-09 15:31:20 +11:00
dweiller
ec5b751373 sema: inherit block want_safety for err switch union 2024-01-09 14:42:12 +11:00
dweiller
fc6dc797ce astgen/sema: fix source locations for switch_block_err_union 2024-01-09 14:42:12 +11:00
dweiller
6a18cee3af astgen/sema: use switch_block_err_union for if-else-switch 2024-01-09 14:42:12 +11:00
dweiller
b7eb59fc14 fix x86_64 crashes for switch_block_err_union
This change only emits the unwrap_errunion_err instruction if the error
capture is actually used in a branch.
2024-01-09 14:42:12 +11:00
dweiller
adcaad6d91 sema: fix err union switch with inferred empty error sets 2024-01-09 14:42:12 +11:00
dweiller
2fa69cce72 sema: allow maybeErrorUnwrap to handle err_union_code 2024-01-09 14:42:12 +11:00
dweiller
a175a64384 sema: implement runtime switch_block_err_union 2024-01-09 14:42:12 +11:00
dweiller
6bf319ebbb sema: extract runtime switch AIR generation to function 2024-01-09 14:42:12 +11:00
dweiller
ae19f699ab sema: implement switch_block_err_union on comptime operands 2024-01-09 14:42:12 +11:00
dweiller
2cf648fba7 astgen: use switch_block_err_union 2024-01-09 14:42:12 +11:00
dweiller
b784f64a6e sema: refactor error set switch logic 2024-01-09 14:42:11 +11:00
dweiller
4136097566 zir: add switch_block_err_union 2024-01-09 14:42:11 +11:00
dweiller
063d55c504 zir: remove unused zir as instruction 2024-01-09 14:42:11 +11:00
Andrew Kelley
3023d2845c compilation: fix bad path in error message 2024-01-08 18:20:06 -07:00
Ali Chraghi
0e856da224 add type safety to ZIR for null terminated strings 2024-01-08 16:33:33 -08:00
Andrew Kelley
4cf08932b5
Merge pull request #16109
Update mingw-w64 to latest git commit
2024-01-08 16:13:14 -08:00
Andrew Kelley
ed410b9c1e lift artificial restriction on minimum glibc version
Fixes a regression introduced in
c22d1c00a8825f60e7b01b97c6f73cbc21ca8257.

See #17769
2024-01-08 13:43:10 -07:00
Andrew Kelley
9a4a74eb65 mingw: remove pow.c from aarch64-windows mingw builds
I observed a duplicate symbol linker error; pow was defined both by
mingwex.lib and ucrtbase.dll.
2024-01-08 11:53:06 -07:00
Andrew Kelley
f5ed441ddb mingw: add the build logic for the previous commit
Separate commits for the zig logic and the copied files.
2024-01-08 11:52:38 -07:00
Andrew Kelley
99922c2708 Compilation: only add __MSVCRT_VERSION__ for -lc
prevents it from being defined twice when building mingw-w64 libs.
2024-01-08 11:52:38 -07:00
Andrew Kelley
7b3afc880b Compilation: add definition to prefer ucrt for windows C/C++ files
This makes C/C++ files when targeting mingw-w64 choose to depend on ucrt
for stdio.
2024-01-08 11:52:38 -07:00
Andrew Kelley
e2a8fe721d mingw: add comments so that I don't regress this code later
Martin Storsjö kindly took the time to discuss things at length with me,
and the results are that this status quo is correct. I added comments so
that I don't think it should be changed later.
2024-01-08 11:52:38 -07:00
Andrew Kelley
3f4c73ae93 mingw: update from msvcrt to ucrt 2024-01-08 11:52:38 -07:00
Andrew Kelley
c26bace606 mingw-w64: update CRT files to latest git commit
Upstream commit dddccbc3ef50ac52bf00723fd2f68d98140aab80

* adds ucrtbase.def.in
* mingwex: replace mingw crt files with ucrt files
* adds missing mingw-w64 ucrt files

The rules that govern which set of files are included or excluded is
contained in the logic for tools/update_mingw.zig
2024-01-08 11:52:38 -07:00