As per the docs (e.g., /apps/intel-tools/.packages/2025.0.1/compiler/2025.0/bin/compiler/README.txt, item 4 and Intel porting guide) and my direct experience when compiling with -flto, the archiver needs to be set to llvm-ar when creating static libraries. Otherwise, an error bfd plugin: LLVM gold plugin has failed to create LTO module: Invalid record appears at the static library creation stage.
A side-effect of compiling with -flto + oneAPI is that the classic and oneAPI compilers can not be mixed. See the porting guide here under section PGO, IPO, and Linking Changes.
One thing to note is that the llvm-ar is intentionally not in the PATH and the recommended way to get the full path is to auto-populate using "dpcpp --print-prog-name=llvm-ar" (from the 2025.0 README.txt on gadi linked above).
As per the docs (e.g.,
/apps/intel-tools/.packages/2025.0.1/compiler/2025.0/bin/compiler/README.txt, item 4 and Intel porting guide) and my direct experience when compiling with-flto, the archiver needs to be set tollvm-arwhen creating static libraries. Otherwise, an errorbfd plugin: LLVM gold plugin has failed to create LTO module: Invalid recordappears at the static library creation stage.A side-effect of compiling with
-flto+ oneAPI is that the classic and oneAPI compilers can not be mixed. See the porting guide here under section PGO, IPO, and Linking Changes.One thing to note is that the
llvm-aris intentionally not in thePATHand the recommended way to get the full path is to auto-populate using"dpcpp --print-prog-name=llvm-ar"(from the2025.0README.txt ongadilinked above).