Add -Wl,--build-id to default linker flags on Linux

Issue #594 resolved
Colin MacLean created an issue

-Wl,--build-id can be used to embed a unique hash into an executable or library. CCS needs this information to operate and will fall back to hashing the text segment at runtime. This linker flag moves hashing the text segments from runtime to compile time, improving performance and avoiding problems with debuggers modifying the code segment when setting breakpoints. It’s not necessary on Mac, as it’s enabled by default, but doesn’t hurt.

This linker flag is available since binutils 2.18 (released 2007) and is present on ld.bfd, ld.gold and ld.llvm, so is widely supported.

Comments (3)

  1. Log in to comment