Merge tag 'kbuild-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-block.git] / arch / x86 / Makefile
index 9afd323c69160240650d40cb452e308c834830f8..415a5d138de47c37c90890a71056775d023f5d7d 100644 (file)
@@ -68,6 +68,7 @@ export BITS
 #    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
 #
 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
+KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
 
 ifeq ($(CONFIG_X86_KERNEL_IBT),y)
 #
@@ -155,8 +156,17 @@ else
         cflags-$(CONFIG_GENERIC_CPU)   += -mtune=generic
         KBUILD_CFLAGS += $(cflags-y)
 
+        rustflags-$(CONFIG_MK8)                += -Ctarget-cpu=k8
+        rustflags-$(CONFIG_MPSC)       += -Ctarget-cpu=nocona
+        rustflags-$(CONFIG_MCORE2)     += -Ctarget-cpu=core2
+        rustflags-$(CONFIG_MATOM)      += -Ctarget-cpu=atom
+        rustflags-$(CONFIG_GENERIC_CPU)        += -Ztune-cpu=generic
+        KBUILD_RUSTFLAGS += $(rustflags-y)
+
         KBUILD_CFLAGS += -mno-red-zone
         KBUILD_CFLAGS += -mcmodel=kernel
+        KBUILD_RUSTFLAGS += -Cno-redzone=y
+        KBUILD_RUSTFLAGS += -Ccode-model=kernel
 endif
 
 #