Skip to content

lto not working with clang

Adding --enable-ipo to the configuration line with clang or aocc breaks. The configuration scripts chokes on the -lm test. Ignoring this, the compilation of SWIFT itself fails.

On cosma, this breaks:

[login7a] > module list
Currently Loaded Modulefiles:
 1) aocc/2.2.0   2) gsl/2.4(default)  
[login7a] > ./configure CC=clang --with-hdf5=/cosma/local/hdf5//intel_2020-update2/1.10.6/bin/h5cc --disable-mpi --enable-compiler-warning --enable-ipo

The error reported in config.log is:

/opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../bin/ld.gold: error: /cosma/local/aocc/aocc-compiler-2.2.0/bin/../lib/LLVMgold.so: could not load plugin library: /cosma/local/aocc/aoc\
c-compiler-2.2.0/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
/opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../bin/ld.gold: error: /tmp/conftest-5f9d8a.o:1:3: invalid character
/opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../bin/ld.gold: error: /tmp/conftest-5f9d8a.o:1:3: syntax error, unexpected $end
/opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../bin/ld.gold: error: /tmp/conftest-5f9d8a.o: not an object or archive

so it seems related to the linker being used.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information