Skip to content

Commit 90b9a1c

Browse files
sulixAlone0316
authored andcommitted
rust: arch/um: Disable FP/SIMD instruction to match x86
[ Upstream commit 8849818679478933dd1d9718741f4daa3f4e8b86 ] The kernel disables all SSE and similar FP/SIMD instructions on x86-based architectures (partly because we shouldn't be using floats in the kernel, and partly to avoid the need for stack alignment, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 ) UML does not do the same thing, which isn't in itself a problem, but does add to the list of differences between UML and "normal" x86 builds. In addition, there was a crash bug with LLVM < 15 / rustc < 1.65 when building with SSE, so disabling it fixes rust builds with earlier compiler versions, see: Rust-for-Linux/linux#881 Signed-off-by: David Gow <[email protected]> Reviewed-by: Sergio González Collado <[email protected]> Signed-off-by: Richard Weinberger <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 27d2f9b commit 90b9a1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/Makefile.um

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
core-y += arch/x86/crypto/
22

3+
#
4+
# Disable SSE and other FP/SIMD instructions to match normal x86
5+
#
6+
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
7+
KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
8+
39
ifeq ($(CONFIG_X86_32),y)
410
START := 0x8048000
511

0 commit comments

Comments
 (0)