llvm16 - LLVMgold.so needs to be installed in /usr/lib/bfd-plugins as well
Using -flto
with clang won't work unless LLVMgold.so
is symlinked to /usr/lib/bfd-plugins
If you don't do that, the linker will complain the archive has no symbol table and also throw a bunch of undefined references to symbol xxxx. After a couple of hours trying to figure out cause, I found this
https://bugs.archlinux.org/task/28479
that bug report describes exactly what was happening to me and, the moment I did what it suggested (symlinked LLVMgold.so
), the problem went away and the finally worked.
Maybe I'm doing something wrong. This is the first time I tried to use clang with Alpine.