Skip to content

The LLVM we ship in rust-dev doesn't match the LLVM we ship in the rustc component #110474

Closed
@jyn514

Description

@jyn514

I tried this code:

; rustc +stage2 --print=target-spec-json --target loongarch64-unknown-linux-gnu -Zunstable-options

I expected to see this happen: rustc prints the target spec successfully, because it knows it exists:

; rustc +stage2 --print=target-list | grep loong
loongarch64-unknown-linux-gnu

Instead, this happened: rustc fails to load the LLVM specification:

; rustc +stage2 --print=target-spec-json --target loongarch64-unknown-linux-gnu -Zunstable-options
error: could not create LLVM TargetMachine for triple: loongarch64-unknown-linux-gnu: No available targets are compatible with triple "loongarch64-unknown-linux-gnu"

Note that this is different from the error we emit for an unrecognized target:

; rustc +stage2 --print=target-spec-json --target unknown -Zunstable-options
error: Error loading target specification: Could not find specification for target "unknown". Run `rustc --print target-list` for a list of built-in targets

Also, this only happens for local builds, because we don't use the LLVM in the rust-dev component in rustup, only when building rustc from source.

... wtf ???

Meta

HEAD is branched from ce1073b

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions