Skip to content

Commit 5879ee1

Browse files
committed
Distinguish different vfp? features
The different generations of ARM floating point VFP correspond to the LLVM CPU features named `vfp2`, `vfp3`, and `vfp4`; they are now exposed in Rust under the same names. This commit fixes some crashes that would occour when checking if the `vfp` feature exists (the crash occurs because the linear scan of the LLVM feature goes past the end of the features whenever it searches for a feature that does not exist in the LLVM tables).
1 parent f942c28 commit 5879ee1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc_driver/target_features.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ use libc::c_char;
2424
pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) {
2525
let target_machine = create_target_machine(sess);
2626

27+
// WARNING: the features must be known to LLVM or the feature
28+
// detection code will walk past the end of the feature array,
29+
// leading to crashes.
30+
2731
let arm_whitelist = [
2832
"neon\0",
29-
"vfp\0",
33+
"vfp2\0",
34+
"vfp3\0",
35+
"vfp4\0",
3036
];
3137

3238
let x86_whitelist = [

0 commit comments

Comments
 (0)