Closed qak closed 2 years ago
On these binaries, clang does not have the libraries for this :/ The only solutions are either to find binaries with these libraries, or to compile by yourself. The options, -flto=thin is not necessarily essential
I am doing PR to update repos and docker images, i will try to make a docker image with all options
Compiling a program fails when enabling link-time optimisations (LTO). The problem can be reproduced by running the following command in the Docker image:
$ echo "int main(){}" >> main.cpp; clang++ main.cpp -flto=thin /usr/bin/ld: /usr/local/bin/../lib/LLVMgold.so: error loading plugin: /usr/local/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
I unfortunately have no idea what should be done to fix this issue.
You can use Dockcross if you want LTO: https://github.com/dockcross/dockcross (linux-x64-clang)
This should now work for all buster
and bullseye
based images (i.e. 7 or higher).
Compiling a program fails when enabling link-time optimisations (LTO). The problem can be reproduced by running the following command in the Docker image:
I unfortunately have no idea what should be done to fix this issue.