Skip to content

Commit c5eae3a

Browse files
committed
x86: rust: move unknown-to-rustc codegen features back to the target spec file
Only a subset of the LLVM codegen features are recognized by `rustc`, and since rust-lang/rust#87402 (Rust 1.61.0) the compiler gives a warning about it: warning: unknown feature specified for `-Ctarget-feature`: `mmx` | = note: it is still passed through to the codegen backend = note: consider filing a feature request ...since those features may be renamed or removed at any point: $ rustc --print target-features [...] Code-generation features cannot be used in cfg or #[target_feature], and may be renamed or removed in a future version of LLVM or rustc. Thus move them back to the target spec generated file. See rust-lang/rust#96472 as well for a report. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 8fafdf2 commit c5eae3a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/x86/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ export BITS
6363
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
6464
#
6565
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
66-
KBUILD_RUSTFLAGS += -Ctarget-feature=-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2
67-
KBUILD_RUSTFLAGS += -Ctarget-feature=-3dnow,-3dnowa,-avx,-avx2,+soft-float
66+
KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
6867

6968
ifeq ($(CONFIG_X86_KERNEL_IBT),y)
7069
#

scripts/generate_rust_target.rs

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ fn main() {
204204
"data-layout",
205205
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
206206
);
207+
ts.push("features", "-3dnow,-3dnowa,-mmx,+soft-float");
207208
ts.push("llvm-target", "x86_64-linux-gnu");
208209
ts.push("target-pointer-width", "64");
209210
} else {

0 commit comments

Comments
 (0)