linux-mips
[Top] [All Lists]

Re: Support for newer gcc/gas options

To: Dimitri Torfs <dimitri@sonycom.com>
Subject: Re: Support for newer gcc/gas options
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Tue, 20 Jan 2004 13:37:16 +0100 (CET)
Cc: linux-mips@linux-mips.org
In-reply-to: <Pine.LNX.4.55.0312231303030.27594@jurand.ds.pg.gda.pl>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20031223114644.GA5458@sonycom.com> <Pine.LNX.4.55.0312231303030.27594@jurand.ds.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 23 Dec 2003, Maciej W. Rozycki wrote:

> >   "cc1: warning: The -march option is incompatible to -mipsN and therefore
> > +ignored."
> > 
> >   when compiling. I have the CONFIG_CPU_VR41XX option set, which sets
> >   the c-flags to:
> > 
> >   "-I /home/dimitri/work/linux/include/asm/gcc -G 0 -mno-abicalls
> >   -fno-pic -pipe  -finline-limit=100000 -mabi=32 -march=r4100 -mips3
> >   -Wa,-32 -Wa,-march=r4100 -Wa,-mips3 -Wa,--trap"
> > 
> >   I suppose that for the newer gcc versions only -march= should be
> >   set (I'm using gcc-3.2.2) ?
> 
>  Thanks for the report -- I suppose we can remove "-mips" whenever
> "-mabi=" is supported by gcc.  I'll do an update in January after I am 
> back from vacation.

 It took a bit longer than I planned, sorry.  Anyway, here are two
functionally equivalent patches, for 2.4 and the head, that remove an ISA
specification if a tool supports "-march=" and "-mabi=" at the same time.  
Please try the appropriate one.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

patch-mips-2.4.23-20031209-mabi-2
diff -up --recursive --new-file 
linux-mips-2.4.23-20031209.macro/arch/mips/Makefile 
linux-mips-2.4.23-20031209/arch/mips/Makefile
--- linux-mips-2.4.23-20031209.macro/arch/mips/Makefile 2003-12-22 
02:35:03.000000000 +0000
+++ linux-mips-2.4.23-20031209/arch/mips/Makefile       2004-01-20 
08:13:20.000000000 +0000
@@ -98,6 +98,12 @@ while :; do \
        gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
        break; \
 done; \
+if test "$gcc_opt" = -march && test -n "$gcc_abi"; then \
+       gcc_isa=; \
+fi; \
+if test "$gas_opt" = -Wa,-march && test -n "$gas_abi"; then \
+       gas_isa=; \
+fi; \
 echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu 
$$gas_isa)
 
 #
diff -up --recursive --new-file 
linux-mips-2.4.23-20031209.macro/arch/mips64/Makefile 
linux-mips-2.4.23-20031209/arch/mips64/Makefile
--- linux-mips-2.4.23-20031209.macro/arch/mips64/Makefile       2003-12-22 
02:32:44.000000000 +0000
+++ linux-mips-2.4.23-20031209/arch/mips64/Makefile     2004-01-20 
08:13:28.000000000 +0000
@@ -87,6 +87,12 @@ while :; do \
        gas_opt=; gas_cpu=; gas_isa=; \
        break; \
 done; \
+if test "$gcc_opt" = -march; then \
+       gcc_isa=; \
+fi; \
+if test "$gas_opt" = -Wa,-march; then \
+       gas_isa=; \
+fi; \
 echo $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
 
 #

patch-mips-2.6.0-20040108-mabi-2
diff -up --recursive --new-file 
linux-mips-2.6.0-20040108.macro/arch/mips/Makefile 
linux-mips-2.6.0-20040108/arch/mips/Makefile
--- linux-mips-2.6.0-20040108.macro/arch/mips/Makefile  2004-01-07 
04:56:39.000000000 +0000
+++ linux-mips-2.6.0-20040108/arch/mips/Makefile        2004-01-20 
08:13:49.000000000 +0000
@@ -111,6 +111,12 @@ done; \
 if test x$(gcc-abi) != x$(gas-abi); then \
        gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
 fi; \
+if test "$gcc_opt" = -march && test -n "$gcc_abi"; then \
+       gcc_isa=; \
+fi; \
+if test "$gas_opt" = -Wa,-march && test -n "$gas_abi"; then \
+       gas_isa=; \
+fi; \
 echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu 
$$gas_isa)
 
 #

<Prev in Thread] Current Thread [Next in Thread>