Closed
Description
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
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
semarie commentedon Nov 22, 2017
cc @alexcrichton @nagisa
semarie commentedon Nov 22, 2017
the error I have while building stock firefox-57 on openbsd with rustc 1.22:
ranma42 commentedon Nov 22, 2017
The limitation was introduced in 881a724
EDIT: to fix compilation after #43492
cuviper commentedon Nov 22, 2017
Isn't
simd
a nightly-only crate? How can Firefox be using it? It's present inthird_party/rust/simd
, but I think that's only as a vendored optional dependency for crates like regex.(It does not appear to be used in Fedora's build of Firefox 57, at least...)
Anyway, AFAIK
MCSubtargetInfo::getFeatureTable()
andgetCPUTable()
are currently the only API changes in rust-lang/llvm. This wasn't a big deal when they were only informational, used forrustc --print target-features --print target-cpus
. But it's more painful if these now affect actual code use. Have these APIs been proposed upstream to LLVM?semarie commentedon Nov 23, 2017
it seems the issue was already present with rust-1.21.0: freebsd already saw it: freebsd bug 223300
at openbsd, rust-1.21.0 was compiled with embedded LLVM. this one with system LLVM. so I only saw it now.
about firefox, it seems that firefox explicitely enable the build with simd for performance reason. see firefox 1261841
semarie commentedon Nov 23, 2017
firefox enable nightly features for simd: config/rules.mk#875
cuviper commentedon Nov 23, 2017
Then Firefox is cheating -- but you still have the option to build it without simd, it seems.
semarie commentedon May 15, 2018
with #49428, the problem should be solved. thanks.