mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
bootstrap: disable strict aliasing
The C backend has always gleefully violated C's strict aliasing rules, and I just got bitten by it for the first time when bootstrapping on macOS. This probably hasn't been helping with some of the weird bootstrap-related CI failures we've seen. So, update `bootstrap.c` and `CMakeLists.txt` to tell GCC/Clang to disable type-based alias analysis. No change is needed to the MSVC flags because MSVC does not, and never has, implemented TBAA.
This commit is contained in:
+2
-2
@@ -608,8 +608,8 @@ if(MSVC)
|
||||
set(ZIG2_LINK_FLAGS "/STACK:16777216 /FORCE:MULTIPLE")
|
||||
else()
|
||||
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
|
||||
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os")
|
||||
set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector")
|
||||
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os -fno-strict-aliasing")
|
||||
set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector -fno-strict-aliasing")
|
||||
# Must match the condition in build.zig.
|
||||
if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$")
|
||||
set(ZIG1_COMPILE_FLAGS "${ZIG1_COMPILE_FLAGS} -ffunction-sections -fdata-sections")
|
||||
|
||||
Reference in New Issue
Block a user