diff --git a/cmake/targets/BuildBun.cmake b/cmake/targets/BuildBun.cmake index ede0b6c305..664ed8e1dc 100644 --- a/cmake/targets/BuildBun.cmake +++ b/cmake/targets/BuildBun.cmake @@ -951,14 +951,22 @@ endif() if(APPLE) target_link_options(${bun} PUBLIC - -dead_strip - -dead_strip_dylibs -Wl,-ld_new -Wl,-no_compact_unwind -Wl,-stack_size,0x1200000 -fno-keep-static-consts -Wl,-map,${bun}.linker-map ) + + # don't strip in debug, this seems to be needed so that the Zig std library + # `*dbHelper` DWARF symbols (used by LLDB for pretty printing) are in the + # output executable + if(NOT DEBUG) + target_link_options(${bun} PUBLIC + -dead_strip + -dead_strip_dylibs + ) + endif() endif() if(LINUX) @@ -995,7 +1003,6 @@ if(LINUX) -Wl,-no-pie -Wl,-icf=safe -Wl,--as-needed - -Wl,--gc-sections -Wl,-z,stack-size=12800000 -Wl,--compress-debug-sections=zlib -Wl,-z,lazy @@ -1011,6 +1018,15 @@ if(LINUX) -Wl,--build-id=sha1 # Better for debugging than default -Wl,-Map=${bun}.linker-map ) + + # don't strip in debug, this seems to be needed so that the Zig std library + # `*dbHelper` DWARF symbols (used by LLDB for pretty printing) are in the + # output executable + if(NOT DEBUG) + target_link_options(${bun} PUBLIC + -Wl,--gc-sections + ) + endif() endif() # --- Symbols list ---