On Tue, Jun 23, 2020 at 11:22:53AM -0700, Andy Lutomirski wrote: > See that same atrocious bug report. It's the insane interaction > between -mno-sse2 and -mpreferred-stack-boundary. So you need to > cc-option them both? Or just stick with a compiler version check, I > guess.
Yes, it was the interaction. This below seems to work. Note the "-msse" in the first argument of cc-option which causes the compiler to error out with /dev/null:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12 Adding Nick for the clang side. @Nick: I'm simply going to add -msse2 with cc-option. Anyway, lemme test this thing a bit more. Thx. --- # CFLAGS for compiling floating point code inside the kernel. x86/Makefile turns # off the generation of FPU/SSE* instructions for kernel proper but FPU_FLAGS # get appended last to CFLAGS and thus override those previous compiler options. # FPU_CFLAGS := -mhard-float -msse FPU_CFLAGS += $(call cc-option,-msse2,) ifdef CONFIG_CC_IS_GCC # Stack alignment mismatch, proceed with caution. # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 # (8B stack alignment). # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 FPU_CFLAGS += $(call cc-option,-msse -mpreferred-stack-boundary=3,-mpreferred-stack-boundary=4) endif obj-$(CONFIG_TEST_FPU) += test_fpu.o CFLAGS_test_fpu.o += $(FPU_CFLAGS) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette