osx - Clang removing dead code during static linking (gcc equivalent of -Wl, --gc-sections) -
i'm linking against static library , wonder how 1 should handle stripping of dead code in llvm/clang. can't find documentation hints clang has equivalent of -wl, --gc-section or -dead_strip.
i assume dead code elimination performed automatically @ higher optimisation levels, that's case in gcc too, right? yet, gcc provides explicit control of via above mentioned flags. clang not provide or missing something?
(the system osx)
dead stripping linker feature, not compiler feature. neither gcc nor clang have it, result. that's why had use -wl
- you're passing flag linker. mac os x linker uses -dead_strip
. can pass flag directly clang invocation , pass through automatically.
Comments
Post a Comment