Skip to content

Commit 940cbb8

Browse files
committed
add ABI target features *before* -Ctarget-features
1 parent f06f568 commit 940cbb8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gcc_util.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
154154
// we will silently correct them rather than silently producing wrong code.
155155
// (The target sanity check tries to catch this, but we can't know which features are
156156
// enabled in GCC by default so we can't be fully sure about that check.)
157-
for feature in abi_enable {
158-
all_rust_features.push((true, feature));
159-
}
160-
for feature in abi_disable {
161-
all_rust_features.push((false, feature));
162-
}
157+
// We add these at the beginning of the list so that `-Ctarget-features` can
158+
// still override it... that's unsound, but more compatible with past behavior.
159+
all_rust_features.splice(
160+
0..0,
161+
abi_enable.iter().map(|&f| (true, f)).chain(abi_disable.iter().map(|&f| (false, f))),
162+
);
163163

164164
// Translate this into GCC features.
165165
let feats = all_rust_features

0 commit comments

Comments
 (0)