| ... | @@ -602,24 +602,17 @@ if(MSVC) | ... | @@ -602,24 +602,17 @@ if(MSVC) |
| 602 | set(ZIG2_COMPILE_FLAGS "/Od") | 602 | set(ZIG2_COMPILE_FLAGS "/Od") |
| 603 | set(ZIG2_LINK_FLAGS "/STACK:16777216 /FORCE:MULTIPLE") | 603 | set(ZIG2_LINK_FLAGS "/STACK:16777216 /FORCE:MULTIPLE") |
| 604 | else() | 604 | else() |
| 605 | set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2") | 605 | set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99") |
| 606 | set(ZIG1_COMPILE_FLAGS "-std=c99 -Os -fno-strict-aliasing") | 606 | set(ZIG1_COMPILE_FLAGS "-std=c99 -Oz -fno-strict-aliasing") |
| 607 | set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector -fno-strict-aliasing") | 607 | set(ZIG2_COMPILE_FLAGS "-std=c99 -Oz -fno-sanitize=undefined -fno-stack-protector -fno-strict-aliasing") |
| | 608 | if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ZIG_HOST_TARGET_ARCH STREQUAL "s390x") |
| | 609 | string(REPLACE -Oz -O0 ZIG2_COMPILE_FLAGS "${ZIG2_COMPILE_FLAGS}") # llvm 22 assertion failure |
| | 610 | endif() |
| 608 | # Must match the condition in build.zig. | 611 | # Must match the condition in build.zig. |
| 609 | if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH EQUAL "hexagon" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$") | 612 | if(ZIG_HOST_TARGET_ARCH MATCHES "^(arm|thumb)(eb)?$" OR ZIG_HOST_TARGET_ARCH EQUAL "hexagon" OR ZIG_HOST_TARGET_ARCH MATCHES "^powerpc(64)?(le)?$") |
| 610 | set(ZIG1_COMPILE_FLAGS "${ZIG1_COMPILE_FLAGS} -ffunction-sections -fdata-sections") | 613 | set(ZIG1_COMPILE_FLAGS "${ZIG1_COMPILE_FLAGS} -ffunction-sections -fdata-sections") |
| 611 | set(ZIG2_COMPILE_FLAGS "${ZIG2_COMPILE_FLAGS} -ffunction-sections -fdata-sections") | 614 | set(ZIG2_COMPILE_FLAGS "${ZIG2_COMPILE_FLAGS} -ffunction-sections -fdata-sections") |
| 612 | endif() | 615 | endif() |
| 613 | if(APPLE) | | |
| 614 | set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000") | | |
| 615 | elseif(MINGW) | | |
| 616 | set(ZIG2_LINK_FLAGS "-Wl,--stack,0x10000000") | | |
| 617 | # Solaris/illumos ld(1) does not provide a --stack-size option. | | |
| 618 | elseif(CMAKE_HOST_SOLARIS) | | |
| 619 | unset(ZIG2_LINK_FLAGS) | | |
| 620 | else() | | |
| 621 | set(ZIG2_LINK_FLAGS "-Wl,-z,stack-size=0x10000000") | | |
| 622 | endif() | | |
| 623 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU") | 616 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 624 | # Prevent GCC from miscompiling 'zig2.c'. See also 'GCC_BUG_119085_PRESENT' workaround details in 'bootstrap.c'. | 617 | # Prevent GCC from miscompiling 'zig2.c'. See also 'GCC_BUG_119085_PRESENT' workaround details in 'bootstrap.c'. |
| 625 | if ( | 618 | if ( |