Skip to content

llvm archiver must be used when compiling with -flto #30

@manodeep

Description

@manodeep

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions