Skip to content

target_feature requires embedded LLVM copy to be usable #46181

Closed
@semarie

Description

@semarie

It seems that target_feature requires the embedded LLVM copy to populate the available target_features.

target_features() in src/librustc_trans/llvm_util.rs iterates on whitelisted lists of features, and check for each if the feature is available, using llvm::LLVMRustHasFeature().

The function comes from src/rustllvm/PassWrapper.cpp, and will return always false if LLVM_RUSTLLVM isn't defined. So if the binded LLVM isn't the embedded copy.

I found it when building rustc 1.22 (prestable) as run-pass/sse2 failed. But firefox-57 depends on simd crate and simd uses target_feature: it makes firefox unbuildable in such situation.

As for distro, it is really a common thing to avoid embedded copy of code, it is really annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-SIMDArea: SIMD (Single Instruction Multiple Data)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions