Compare commits

...

1 Commits

Author SHA1 Message Date
Claude Bot
eb2113b17d fix(cmake): reduce noise in debug build linker flags on Linux
Move optimization-focused linker flags to release builds only:
- --icf=safe: identical code folding for size optimization
- -O2: enable string tail merging optimization
- -z,combreloc: combine relocations for faster loading

Keep debugging-related flags in all builds:
- --compress-debug-sections=zlib: compress debug sections for smaller files
- --gdb-index: faster debug symbol loading in GDB

This reduces verbose linker output and link times in debug builds
while preserving essential debugging functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 05:31:11 +00:00

View File

@@ -993,24 +993,29 @@ if(LINUX)
--ld-path=${LLD_PROGRAM}
-fno-pic
-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
-Wl,-z,norelro
# enable string tail merging
-Wl,-O2
# 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
# make debug info faster to load
-Wl,--gdb-index
-Wl,-Map=${bun}.linker-map
)
if(RELEASE)
target_link_options(${bun} PUBLIC
-Wl,-icf=safe
# enable string tail merging
-Wl,-O2
-Wl,-z,combreloc
)
endif()
endif()
# --- Symbols list ---