Skip to content

Cross linker lto error: conflict llvm version. #145981

@Wyvern

Description

@Wyvern

rustc 1.91.0-nightly (f2824da98 2025-08-28)
build with -Zbuild-std got compile error like below:

error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "-Wl,-exported_symbols_list" "-Wl,/var/folders/x7/ch5v91h56_zbvbd1y2f600dm0000gn/T/rustcfEM3e0/list" "<1 object files omitted>" "/.../build-dir/aarch64-apple-ios/src/deps/libcompiler_builtins-75a2186d30a4b1be.rlib" "-liconv" "-lSystem" "-lc" "-lm" "-target" "arm64-apple-ios10.0.0" "-o" "/.../build-dir/aarch64-apple-ios/src/deps/Img-c7767a3ba0b3d1d4" "-Wl,-dead_strip" "-nodefaultlibs" "-Wl,-no_uuid" "-Wl,-S" "-Wl,-dead_strip" "-Wl,-dead_strip_dylibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: ld: could not parse bitcode object file /.../build-dir/aarch64-apple-ios/src/deps/libcompiler_builtins-75a2186d30a4b1be.rlib[3](compiler_builtins-75a2186d30a4b1be.compiler_builtins.ab41fbc527b53a2f-cgu.0.rcgu.o): 'Invalid attribute group entry (Producer: 'LLVM21.1.0-rust-1.91.0-nightly' Reader: 'LLVM APPLE_1_1600.0.26.3_0')', using libLTO version 'LLVM version 16.0.0' in '/.../build-dir/aarch64-apple-ios/src/deps/libcompiler_builtins-75a2186d30a4b1be.rlib[3](compiler_builtins-75a2186d30a4b1be.compiler_builtins.ab41fbc527b53a2f-cgu.0.rcgu.o)'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Invalid attribute group entry (Producer: 'LLVM21.1.0-rust-1.91.0-nightly' Reader: 'LLVM APPLE_1_1600.0.26.3_0')

Similar errors occurred on other targets too,

such as unix
Invalid attribute group entry (Producer: 'LLVM21.1.0-rust-1.91.0-nightly' Reader: 'LLVM 18.1.3'),

or Android
Unknown attribute kind (103) (Producer: 'LLVM21.1.0-rust-1.91.0-nightly' Reader: 'LLVM 19.0.1')

Add "-Clinker-plugin-lto=no" as workaround can fix this error temporarily.

It affects all cross build targets except windows targets.

Metadata

Metadata

Assignees

Labels

A-LTOArea: Link-time optimization (LTO)C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-prioritizeIssue: Indicates that prioritization has been requested for this issue.S-has-bisectionStatus: A bisection has been found for this issueS-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions