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
This commit is contained in:
Jacob Young 2022-12-06 03:52:29 -05:00 committed by Andrew Kelley
parent 2a3d9c321e
commit a0a2e75773

View File

@ -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()