commit a0a2e757730cdf8fa8fe3df6f155d0aae1303438 (tree)
parent 2a3d9c321e95af5fea54321015fd4a579e0c4158
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date: Tue, 6 Dec 2022 03:52:29 -0500
cmake: disable stack protector for zig2 to avoid link errors on windows
On windows we get:
lld-link: error: undefined symbol: __stack_chk_fail
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(main)
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(main_main)
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(log_scoped_28_default_29_err__anon_2764)
>>> referenced 36192 more times
lld-link: error: undefined symbol: __stack_chk_guard
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(.refptr.__stack_chk_guard)
>>> referenced by CMakeFiles/zig2.dir/compiler_rt.c.obj
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -730,7 +730,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")
+ set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-stack-protector")
if(APPLE)
set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000")
else()