diff --git a/CMakeLists.txt b/CMakeLists.txt index caef5904fa6c74..98328a64048881 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1202,13 +1202,11 @@ endif() if(UNIX AND NOT APPLE) target_link_options(${bun} PUBLIC - "-fuse-ld=lld" - "-fno-pic" - "-no-pie" - "-Wl,-z,lazy" - "-Wl,-z,norelro" - "-static-libstdc++" - "-static-libgcc" + -fuse-ld=lld + -fno-pic + -static-libstdc++ + -static-libgcc + "-Wl,-no-pie,-relative-cap-relocs" "-Wl,-icf=safe" "-Wl,--as-needed" "-Wl,--gc-sections" @@ -1238,6 +1236,8 @@ if(UNIX AND NOT APPLE) "-rdynamic" "-Wl,--dynamic-list=${BUN_SRC}/symbols.dyn" "-Wl,--version-script=${BUN_SRC}/linker.lds" + -Wl,-z,lazy + -Wl,-z,norelro ) target_link_libraries(${bun} PRIVATE "c") diff --git a/build.zig b/build.zig index a97cad7ac7a1bc..20c65eff9e089b 100644 --- a/build.zig +++ b/build.zig @@ -342,6 +342,7 @@ pub fn addBunObject(b: *Build, opts: *BunBuildOptions) *Compile { // https://github.com/ziglang/zig/issues/17430 .pic = true, + .omit_frame_pointer = false, .strip = false, // stripped at the end }); obj.bundle_compiler_rt = false;