diff --git a/cmake/targets/BuildBun.cmake b/cmake/targets/BuildBun.cmake index 945f8074fb..da416f67db 100644 --- a/cmake/targets/BuildBun.cmake +++ b/cmake/targets/BuildBun.cmake @@ -1098,6 +1098,17 @@ if(LINUX) ) endif() + if (ENABLE_LTO) + # We are optimizing for size at a slight debug-ability cost + target_link_options(${bun} PUBLIC + -Wl,--no-eh-frame-hdr + ) + else() + target_link_options(${bun} PUBLIC + -Wl,--eh-frame-hdr + ) + endif() + target_link_options(${bun} PUBLIC --ld-path=${LLD_PROGRAM} -fno-pic @@ -1112,7 +1123,6 @@ if(LINUX) # make debug info faster to load -Wl,--gdb-index -Wl,-z,combreloc - -Wl,--no-eh-frame-hdr -Wl,--sort-section=name -Wl,--hash-style=both -Wl,--build-id=sha1 # Better for debugging than default