Skip to content

Commit 5550187

Browse files
sulixjmberg-intel
authored andcommitted
um: Pass the correct Rust target and options with gcc
In order to work around some issues with disabling SSE on older versions of gcc (compilation would fail upon seeing a function declaration containing a float, even if it was never called or defined), the corresponding CFLAGS and RUSTFLAGS were only set when using clang. However, this led to two problems: - Newer gcc versions also wouldn't get the correct flags, despite not having the bug. - The RUSTFLAGS for setting the rust target definition were not set, despite being unrelated. This works by chance for x86_64, as the built-in default target is close enough, but not for 32-bit x86. Move the target definition outside the conditional block, and update the condition to take into account the gcc version. Fixes: a3046a6 ("um: Only disable SSE on clang to work around old GCC bugs") Signed-off-by: David Gow <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 7eb1721 commit 5550187

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/x86/Makefile.um

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ core-y += arch/x86/crypto/
77
# GCC versions < 11. See:
88
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652
99
#
10-
ifeq ($(CONFIG_CC_IS_CLANG),y)
11-
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
12-
KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
10+
ifeq ($(call gcc-min-version, 110000)$(CONFIG_CC_IS_CLANG),y)
11+
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
1312
KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
1413
endif
1514

15+
KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
16+
1617
ifeq ($(CONFIG_X86_32),y)
1718
START := 0x8048000
1819

0 commit comments

Comments
 (0)