bootstrap.c: work around the gcc sra miscomp using preprocessor checks rather than CLI arg (#31589)

Closes #31577
I've also extended the "good" ranges to fit versions >14.3 and >13.4, since both of these branches have the fix merged so if they ever make a dot release it should be good.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31589
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: fardragon <michaldrozd@protonmail.ch>
Co-committed-by: fardragon <michaldrozd@protonmail.ch>
This commit is contained in:
fardragon
2026-03-20 04:55:51 +01:00
committed by Andrew Kelley
parent 3c8b96df6d
commit 4acecad933
3 changed files with 66 additions and 28 deletions
+1 -2
View File
@@ -21,8 +21,7 @@ export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
# Test building from source without LLVM.
cc -o bootstrap bootstrap.c
# See comments in bootstrap.c for an explanation of the flag given here.
./bootstrap --workaround-gcc-sra-miscomp
./bootstrap
./zig2 build -Dno-lib
./zig-out/bin/zig test test/behavior.zig