On 10/11/2014 11:09 AM, Manuel Lauss wrote: > Starting with version 2.24.51.20140728 MIPS binutils complain loudly > about mixing soft-float and hard-float object files, leading to this > build failure since GCC is invoked with "-msoft-float" on MIPS: > > {standard input}: Warning: .gnu_attribute 4,3 requires `softfloat' > LD arch/mips/alchemy/common/built-in.o > mipsel-softfloat-linux-gnu-ld: Warning: arch/mips/alchemy/common/built-in.o > uses -msoft-float (set by arch/mips/alchemy/common/prom.o), > arch/mips/alchemy/common/sleeper.o uses -mhard-float > > To fix this, we detect if GAS is new enough to support "-msoft-float" command > option, and if it does, we can let GCC pass it to GAS; but then we also need > to sprinkle the files which make use of floating point registers with the > necessary ".set hardfloat" directives. > > Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxx> > --- > I've only tested a mips32r1 build, but at least binutils-2.23 and a > snapshot from today (with the MIPS fp changes) compile a bootable > kernel. > > Tests on 64bit and with MSA and other extensions also appreciated! > > v3: incorporate Maciej's suggestions: > - detect if gas can handle -msoft-float and ".set hardfloat" > - apply .set hardfloat only where really necessary > > v2: cover more files > > This was introduced in binutils commit 351cdf24d223290b15fa991e5052ec9e9bd1e284 > ("[MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions"). > > arch/mips/Makefile | 9 +++++++++ > arch/mips/include/asm/asmmacro-32.h | 5 +++++ > arch/mips/include/asm/asmmacro.h | 18 ++++++++++++++++++ > arch/mips/include/asm/fpregdef.h | 14 ++++++++++++++ > arch/mips/include/asm/mipsregs.h | 19 +++++++++++++++++++ > arch/mips/kernel/genex.S | 1 + > arch/mips/kernel/r2300_switch.S | 5 +++++ > arch/mips/kernel/r4k_fpu.S | 7 +++++++ > arch/mips/kernel/r4k_switch.S | 9 +++++++++ > arch/mips/kernel/r6000_fpu.S | 5 +++++ > 10 files changed, 92 insertions(+) > Hi, I applied this patch but it still does not build for me on a malta_defconfig: arch/mips/kernel/r4k_fpu.S: Assembler messages: arch/mips/kernel/r4k_fpu.S:52: Error: float register should be even, was 1 arch/mips/kernel/r4k_fpu.S:53: Error: float register should be even, was 3 arch/mips/kernel/r4k_fpu.S:54: Error: float register should be even, was 5 arch/mips/kernel/r4k_fpu.S:55: Error: float register should be even, was 7 ... The error is different this time so we probably need a follow-up patch -- markos