From b8b9d70cdda0a293183f4b6265b8ebeb0f4f2e4a Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 12 Oct 2025 11:53:59 -0700 Subject: [PATCH] Emit eh-frame-hdr when not using LTO --- cmake/targets/BuildBun.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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