Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

From: Borislav Petkov
Date: Tue Jun 23 2020 - 06:28:43 EST


On Mon, Jun 22, 2020 at 12:37:12PM -0700, Andy Lutomirski wrote:
> Itâs this whole mess:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383

It really is a mess because our option detection doesn't really work. I did:

ifdef CONFIG_CC_IS_GCC
ifeq ($(call cc-option-yn,-mpreferred-stack-boundary=3),y)
dummy := $(error "gcc supports -mpreferred-stack-boundary=3")
endif
...

and doing:

$ make CC=gcc-4.8 HOSTCC=gcc-4.8 V=1 lib/test_fpu.ko

gives

lib/Makefile:110: *** "gcc supports -mpreferred-stack-boundary=3". Stop.

That same compiler, however, says:

$ gcc-4.8 -mpreferred-stack-boundary=3 -c /tmp/foo.c
/tmp/foo.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12

so I need to dig deep into cc-option* fun.

Or, I can be lazy and simply cut off all compiler versions to >= 8
and be done with it. If people wanna run selftests, they can upgrade
toolchain too...

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette