Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Manuel Lauss <manuel.lauss@gmail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Subject: [RFC PATCH V2] MIPS: fix build with binutils 2.24.51+
Date: Tue, 19 Aug 2014 18:27:12 +0200	[thread overview]
Message-ID: <1408465632-34262-1-git-send-email-manuel.lauss@gmail.com> (raw)

With binutils snapshots since 29.07.2014 I get the following build failure:
{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

Extend cflags with a soft-float directive for the assembler, and add
hardfloat directives to assembler files dealing with FPU
registers to compensate.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
---
V2: cover more assembler files.

This was introduced in binutils commit  351cdf24d223290b15fa991e5052ec9e9bd1e284
("[MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions"), and it seems is only
a problem with my gcc 4.9 or a very recent snapshot of gcc-4.10.
With gcc-4.8, the source builds, with 4.9 it aborts after the above error,
with 4.10 (which apparently passes -msoft-float along to the assembler automatically)
the .hardfloat directives are required.

 arch/mips/Makefile              | 2 +-
 arch/mips/kernel/r2300_switch.S | 1 +
 arch/mips/kernel/r4k_fpu.S      | 1 +
 arch/mips/kernel/r4k_switch.S   | 1 +
 arch/mips/kernel/r6000_fpu.S    | 1 +
 5 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 9336509..cffbd49 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -88,7 +88,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
 cflags-y			+= -G 0 -mno-abicalls -fno-pic -pipe
-cflags-y			+= -msoft-float
+cflags-y			+= -msoft-float -Wa,-msoft-float
 LDFLAGS_vmlinux			+= -G 0 -static -n -nostdlib
 KBUILD_AFLAGS_MODULE		+= -mlong-calls
 KBUILD_CFLAGS_MODULE		+= -mlong-calls
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 20b7b04..f33bf8b 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -22,6 +22,7 @@
 #include <asm/asmmacro.h>
 
 	.set	mips1
+	.set	hardfloat
 	.align	5
 
 /*
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 8352523..722962c 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -21,6 +21,7 @@
 
 	.macro	EX insn, reg, src
 	.set	push
+	.set	hardfloat
 	.set	nomacro
 .ex\@:	\insn	\reg, \src
 	.set	pop
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 4c4ec18..5313b6f 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -34,6 +34,7 @@
  *		       struct thread_info *next_ti, s32 fp_save)
  */
 	.align	5
+	.set hardfloat
 	LEAF(resume)
 	mfc0	t1, CP0_STATUS
 	LONG_S	t1, THREAD_STATUS(a0)
diff --git a/arch/mips/kernel/r6000_fpu.S b/arch/mips/kernel/r6000_fpu.S
index da0fbe4..c13e3ff 100644
--- a/arch/mips/kernel/r6000_fpu.S
+++ b/arch/mips/kernel/r6000_fpu.S
@@ -17,6 +17,7 @@
 #include <asm/regdef.h>
 
 	.set	noreorder
+	.set	hardfloat
 	.set	mips2
 	/* Save floating point context */
 	LEAF(_save_fp_context)
-- 
2.0.4

             reply	other threads:[~2014-08-19 16:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 16:27 Manuel Lauss [this message]
2014-08-25 12:51 ` [RFC PATCH V2] MIPS: fix build with binutils 2.24.51+ Ralf Baechle
2014-08-25 14:27   ` Maciej W. Rozycki
2014-08-25 19:29     ` Manuel Lauss
2014-08-25 19:57       ` Ralf Baechle
2014-08-25 19:57       ` Maciej W. Rozycki
2014-08-26 10:45         ` Matthew Fortune
2014-08-26 10:45           ` Matthew Fortune
2014-10-10 14:39       ` Markos Chandras
2014-10-10 14:39         ` Markos Chandras
2014-10-10 14:40         ` Markos Chandras
2014-10-10 14:40           ` Markos Chandras
2014-10-11  6:53           ` Manuel Lauss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408465632-34262-1-git-send-email-manuel.lauss@gmail.com \
    --to=manuel.lauss@gmail.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox