1

I am building with Clang 9.0.0 and linking with the ld.lld linker

clang++.exe -Wall -fexceptions -m64 -O3 -Xclang -flto-visibility-public-std -std=c++2a -flto=thin  -c
  I:\Cpp\hello_boost\hello_codeblocks_world\hello_codeblocks_world.cpp -o obj\release\hello_codeblocks_world.o

clang++.exe  -o bin\release\hello_codeblocks_world.exe obj\release\hello_codeblocks_world.o  -m64 -fuse-ld=lld --strip-all  

but, unlike when using the usual GCC linker LD, this option (--strip-all or -s) is not recognized

clang++: error: unsupported option '--strip-all' (or similarly with -s)

Can anyone suggest what I should be doing to strip symbols?

(My release-mode hello_world.exe size is 15 kb for GC but 230 kB for Clang :-( and this is likely to have some adverse effects for no benefit).

Is this not an option for ld.lld ?

Thanks

1 Answers1

0

You might want to use: -Xlinker --strip-all You can use this to supply system-specific linker options that GCC does not recognize (gcc manual) https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

billy
  • 1