linux/arch/mips/vdso
Paul Burton 0648e50e54
MIPS: VDSO: Use same -m%-float cflag as the kernel proper
The MIPS VDSO build currently doesn't provide the -msoft-float flag to
the compiler as the kernel proper does. This results in an attempt to
use the compiler's default floating point configuration, which can be
problematic in cases where this is incompatible with the target CPU's
-march= flag. For example decstation_defconfig fails to build using
toolchains in which gcc was configured --with-fp-32=xx with the
following error:

    LDS     arch/mips/vdso/vdso.lds
  cc1: error: '-march=r3000' requires '-mfp32'
  make[2]: *** [scripts/Makefile.build:379: arch/mips/vdso/vdso.lds] Error 1

The kernel proper avoids this error because we build with the
-msoft-float compiler flag, rather than using the compiler's default.
Pass this flag through to the VDSO build so that it too becomes agnostic
to the toolchain's floating point configuration.

Note that this is filtered out from KBUILD_CFLAGS rather than simply
always using -msoft-float such that if we switch the kernel to use
-mno-float in the future the VDSO will automatically inherit the change.

The VDSO doesn't actually include any floating point code, and its
.MIPS.abiflags section is already manually generated to specify that
it's compatible with any floating point ABI. As such this change should
have no effect on the resulting VDSO, apart from fixing the build
failure for affected toolchains.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Kevin Hilman <khilman@baylibre.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Kevin Hilman <khilman@baylibre.com>
References: https://lore.kernel.org/linux-mips/1477843551-21813-1-git-send-email-linux@roeck-us.net/
References: https://kernelci.org/build/id/5c4e4ae059b5142a249ad004/logs/
Fixes: ebb5e78cc6 ("MIPS: Initial implementation of a VDSO")
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@vger.kernel.org
Cc: stable@vger.kernel.org # v4.4+
2019-01-29 11:50:41 -08:00
..
.gitignore
elf.S MIPS: VDSO: Replace __mips_isa_rev with MIPS_ISA_REV 2018-03-09 11:22:48 +00:00
genvdso.c
genvdso.h MIPS: genvdso: Remove GOT checks 2018-08-06 15:28:46 -07:00
gettimeofday.c MIPS: VDSO: Avoid use of linux/irqchip/mips-gic.h 2017-09-04 13:53:14 +02:00
Makefile MIPS: VDSO: Use same -m%-float cflag as the kernel proper 2019-01-29 11:50:41 -08:00
sigreturn.S MIPS: Add DWARF unwinding to assembly 2017-09-06 11:01:52 +02:00
vdso.h MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() 2015-11-11 08:36:41 +01:00
vdso.lds.S MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() 2015-11-11 08:36:41 +01:00