mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +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
1 changed files with 1 additions and 1 deletions
|
|
@ -809,7 +809,7 @@ if(MSVC)
|
|||
else()
|
||||
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
|
||||
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)
|
||||
set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000")
|
||||
elseif(MINGW)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue