mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
cmake: Pass -fno-sanitize=undefined when building zig2.
We build zig2.c and compiler_rt.c with -O0 but then proceed to link with -O3. So zig2.o and compiler_rt.o will have references to ubsan-rt symbols, but the -O3 causes the compiler to not link ubsan-rt. We don't actually need the safety here, so just explicitly disable ubsan.
This commit is contained in:
parent
c3e88a21fb
commit
957a5ae560
@ -809,7 +809,7 @@ if(MSVC)
|
|||||||
else()
|
else()
|
||||||
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
|
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
|
||||||
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os")
|
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os")
|
||||||
set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-stack-protector")
|
set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector")
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000")
|
set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000")
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user