All of lore.kernel.org
 help / color / mirror / Atom feed
* Support for newer gcc/gas options
@ 2003-12-23 11:46 Dimitri Torfs
  2003-12-23 12:05 ` Maciej W. Rozycki
  0 siblings, 1 reply; 15+ messages in thread
From: Dimitri Torfs @ 2003-12-23 11:46 UTC (permalink / raw)
  To: macro; +Cc: linux-mips

Hi,

  I just upgraded to the arch/mips/Makefile which adds support for newer
  gcc/gas options. I now get the warning

  "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) ?

  Dimitri

-- 
Dimitri Torfs             |  NSCE 
dimitri.torfs@sonycom.com |  Sint Stevens Woluwestraat 55
tel: +32 2 2908451        |  1130 Brussel
fax: +32 2 7262686        |  Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2003-12-23 11:46 Support for newer gcc/gas options Dimitri Torfs
@ 2003-12-23 12:05 ` Maciej W. Rozycki
  2004-01-09 22:01   ` Dimitri Torfs
  2004-01-20 12:37   ` Maciej W. Rozycki
  0 siblings, 2 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2003-12-23 12:05 UTC (permalink / raw)
  To: Dimitri Torfs; +Cc: linux-mips

On Tue, 23 Dec 2003, Dimitri Torfs wrote:

>   I just upgraded to the arch/mips/Makefile which adds support for newer
>   gcc/gas options. I now get the warning
> 
>   "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.

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2003-12-23 12:05 ` Maciej W. Rozycki
@ 2004-01-09 22:01   ` Dimitri Torfs
  2004-01-10  1:19     ` Thiemo Seufer
  2004-01-20 12:37   ` Maciej W. Rozycki
  1 sibling, 1 reply; 15+ messages in thread
From: Dimitri Torfs @ 2004-01-09 22:01 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

On Tue, Dec 23, 2003 at 01:05:29PM +0100, Maciej W. Rozycki wrote:
> On Tue, 23 Dec 2003, Dimitri Torfs wrote:
> 
> >   I just upgraded to the arch/mips/Makefile which adds support for newer
> >   gcc/gas options. I now get the warning
> > 
> >   "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.

Tried removing the -mips3 gcc option => -D_MIPS_ISA=_MIPS_ISA_MIPS1 is
set. I think it might be better to use "-mtune=<cpu> -mipsN". That
seems to set the correct options, without any warnings (using gcc
3.2.2). After having carefully read the gcc documentation (again)
regarding the MIPS options, I think that's the way to go for newer
gcc's as well. If anyone has already tried ?



Dimitri



-- 
Dimitri Torfs       |  NSCE 
dimitri@sonycom.com |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-09 22:01   ` Dimitri Torfs
@ 2004-01-10  1:19     ` Thiemo Seufer
  2004-01-10  8:03       ` Dimitri Torfs
  0 siblings, 1 reply; 15+ messages in thread
From: Thiemo Seufer @ 2004-01-10  1:19 UTC (permalink / raw)
  To: Dimitri Torfs; +Cc: Maciej W. Rozycki, linux-mips

Dimitri Torfs wrote:
[snip]
> >  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.
> 
> Tried removing the -mips3 gcc option => -D_MIPS_ISA=_MIPS_ISA_MIPS1 is
> set. I think it might be better to use "-mtune=<cpu> -mipsN". That
> seems to set the correct options, without any warnings (using gcc
> 3.2.2). After having carefully read the gcc documentation (again)
> regarding the MIPS options, I think that's the way to go for newer
> gcc's as well. If anyone has already tried ?

The supposed way is to use -mabi=FOO -march=BAR, where BAR can also be
e.g. "mips3". This will choose the proper (probably generic) architecture
as well as the ISA defines. Btw, the ISA defines aren't used in the
kernel anymore.


Thiemo

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-10  1:19     ` Thiemo Seufer
@ 2004-01-10  8:03       ` Dimitri Torfs
  0 siblings, 0 replies; 15+ messages in thread
From: Dimitri Torfs @ 2004-01-10  8:03 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: Maciej W. Rozycki, linux-mips

On Sat, Jan 10, 2004 at 02:19:22AM +0100, Thiemo Seufer wrote:
> [snip]
> The supposed way is to use -mabi=FOO -march=BAR, where BAR can also be
> e.g. "mips3". 

The -march=mipsN is from gcc-3.3 and higher, right ? 

> This will choose the proper (probably generic) architecture
> as well as the ISA defines. 

I expected, when using -march=r4100, that MIPS3 would be used. That was
apparently not the case (is this maybe a bug in gcc-3.2.2 ?).

> Btw, the ISA defines aren't used in the
> kernel anymore.

Well, asm-mips/asm.h still contains some #ifdef's based on the
_MIPS_ISA. 


Dimitri

-- 
Dimitri Torfs       |  NSCE 
dimitri@sonycom.com |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2003-12-23 12:05 ` Maciej W. Rozycki
  2004-01-09 22:01   ` Dimitri Torfs
@ 2004-01-20 12:37   ` Maciej W. Rozycki
  2004-01-20 12:45     ` Thiemo Seufer
  2004-01-20 20:40     ` Dimitri Torfs
  1 sibling, 2 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2004-01-20 12:37 UTC (permalink / raw)
  To: Dimitri Torfs; +Cc: linux-mips

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)
 
 #

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-20 12:37   ` Maciej W. Rozycki
@ 2004-01-20 12:45     ` Thiemo Seufer
  2004-01-20 12:59       ` Maciej W. Rozycki
  2004-01-20 20:40     ` Dimitri Torfs
  1 sibling, 1 reply; 15+ messages in thread
From: Thiemo Seufer @ 2004-01-20 12:45 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

Maciej W. Rozycki wrote:
[snip]
>  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.  

FYI:
A test for the existence of -march= should be enough, -mabi= was
implemented earlier. OTOH, it does no harm to check both.


Thiemo

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-20 12:45     ` Thiemo Seufer
@ 2004-01-20 12:59       ` Maciej W. Rozycki
  0 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2004-01-20 12:59 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: linux-mips

On Tue, 20 Jan 2004, Thiemo Seufer wrote:

> >  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.  
> 
> FYI:
> A test for the existence of -march= should be enough, -mabi= was
> implemented earlier. OTOH, it does no harm to check both.

 Well, FWIW my port of gcc 2.95.4 supports -march= (by aliasing it to
-mcpu=, but the option is passed down to gas as is) to cooperate with
current binutils, but its support for -mabi= varies depending on the
configuration: mips64el-linux-gcc does support the option, but
mipsel-linux-gcc does not.  I suppose others may also want to have -march=
support in 2.95.4 for binutils compatibility, especially as AFAICS 2.95.4
has a huge speed advantage over later versions of gcc.

  Maciej

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-20 12:37   ` Maciej W. Rozycki
  2004-01-20 12:45     ` Thiemo Seufer
@ 2004-01-20 20:40     ` Dimitri Torfs
  2004-01-21 14:09       ` Maciej W. Rozycki
  1 sibling, 1 reply; 15+ messages in thread
From: Dimitri Torfs @ 2004-01-20 20:40 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

On Tue, Jan 20, 2004 at 01:37:16PM +0100, Maciej W. Rozycki wrote:
> 
>  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.
> 

Tried the head one, it had some typos (patch follows). Unfortunately, as I wrote
earlier, gcc-3.2 doesn't set the ISA correctly when using -march=, so
it doesn't work for 3.2. 


--- linux-mips-2.6.orig/arch/mips/Makefile	2004-01-06 21:17:57.000000000 +0100
+++ linux.work/arch/mips/Makefile	2004-01-20 21:14:12.000000000 +0100
@@ -111,6 +111,12 @@
 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)
 
 #


-- 
Dimitri Torfs       |  NSCE 
dimitri@sonycom.com |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-20 20:40     ` Dimitri Torfs
@ 2004-01-21 14:09       ` Maciej W. Rozycki
  2004-01-21 14:51         ` Dimitri Torfs
  0 siblings, 1 reply; 15+ messages in thread
From: Maciej W. Rozycki @ 2004-01-21 14:09 UTC (permalink / raw)
  To: Dimitri Torfs; +Cc: linux-mips

On Tue, 20 Jan 2004, Dimitri Torfs wrote:

> >  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.
> 
> Tried the head one, it had some typos (patch follows). Unfortunately, as I wrote

 Oops, thanks for the correction -- as I still have only gcc 2.95.4, I
wasn't able to see the typos immediately.

> earlier, gcc-3.2 doesn't set the ISA correctly when using -march=, so
> it doesn't work for 3.2. 

 But do we care of the ISA?  I don't think so -- it's just a leftover from
the days the MIPS world was less complicated.  If gcc 3.2 correctly emits
code for the selected processor and obeys the selected ABI, then
everything is fine.  Are the binaries correct?  If so, I'd like to apply
the patch.

 The few remaining bits in <asm/asm.h> that still depend on _MIPS_ISA
should be rewritten to make use of appropriate CONFIG_CPU_HAS_* settings.  
Or perhaps we can just scrap them -- nothing uses them at all (and current
gcc is able to emit conditional move instructions itself).  OTOH, for
hand-coded assembly it might be a good idea to put them into gas as macros
-- similarly to what gas does for the Alpha for certain instructions that
are only available with later architecture revisions.  I'll work on it in
some spare time.

  Maciej

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-21 14:09       ` Maciej W. Rozycki
@ 2004-01-21 14:51         ` Dimitri Torfs
  2004-01-21 18:35           ` Dimitri Torfs
  0 siblings, 1 reply; 15+ messages in thread
From: Dimitri Torfs @ 2004-01-21 14:51 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

On Wed, Jan 21, 2004 at 03:09:12PM +0100, Maciej W. Rozycki wrote:
> On Tue, 20 Jan 2004, Dimitri Torfs wrote:
> 
> > >  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.
> > 
> > Tried the head one, it had some typos (patch follows). Unfortunately, as I wrote
> 
>  Oops, thanks for the correction -- as I still have only gcc 2.95.4, I
> wasn't able to see the typos immediately.
> 
> > earlier, gcc-3.2 doesn't set the ISA correctly when using -march=, so
> > it doesn't work for 3.2. 
> 
>  But do we care of the ISA?  I don't think so -- it's just a leftover from
> the days the MIPS world was less complicated.  If gcc 3.2 correctly emits
> code for the selected processor and obeys the selected ABI, then
> everything is fine.  Are the binaries correct?  If so, I'd like to apply
> the patch.

I actually had problems compiling when the -mips3 was not set. The
compiler choked on compiling some empty file, if I remember correctly.
I will try again later to see what exactly went wrong.

Dimitri



-- 
Dimitri Torfs       |  NSCE 
dimitri@sonycom.com |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-21 14:51         ` Dimitri Torfs
@ 2004-01-21 18:35           ` Dimitri Torfs
  2004-01-22 16:10             ` Maciej W. Rozycki
  0 siblings, 1 reply; 15+ messages in thread
From: Dimitri Torfs @ 2004-01-21 18:35 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

On Wed, Jan 21, 2004 at 03:51:20PM +0100, Dimitri Torfs wrote:
> On Wed, Jan 21, 2004 at 03:09:12PM +0100, Maciej W. Rozycki wrote:
> >  But do we care of the ISA?  I don't think so -- it's just a leftover from
> > the days the MIPS world was less complicated.  If gcc 3.2 correctly emits
> > code for the selected processor and obeys the selected ABI, then
> > everything is fine.  Are the binaries correct?  If so, I'd like to apply
> > the patch.
> 
> I actually had problems compiling when the -mips3 was not set. The
> compiler choked on compiling some empty file, if I remember correctly.
> I will try again later to see what exactly went wrong.

Compiler choked on the first file it tries to compile: gcc added
-mips1 automatically to the as command line which conflicts with the
-Wa,--trap option:

/usr/local/lib/gcc-lib/mips-linux/3.2.2/../../../../mips-linux/bin/as
 -G 0 -O2 -g0 -32 -march=r4100 -v -mips1 -non_shared -32 -march=r4100
 --trap -o scripts/.tmp_empty.o -
Assembler messages:
Error: trap exception not supported at ISA 1

Removing the line which unsets the gas_isa option makes it work again:
/usr/local/lib/gcc-lib/mips-linux/3.2.2/../../../../mips-linux/bin/as
-G 0 -O2 -g0 -32 -march=r4100 -v -mips1 -non_shared -32 -march=r4100
-mips3 --trap -o scripts/.tmp_empty.o

Dimitri


-- 
Dimitri Torfs       |  NSCE 
dimitri@sonycom.com |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-21 18:35           ` Dimitri Torfs
@ 2004-01-22 16:10             ` Maciej W. Rozycki
  2004-01-25 19:17               ` Dimitri Torfs
  0 siblings, 1 reply; 15+ messages in thread
From: Maciej W. Rozycki @ 2004-01-22 16:10 UTC (permalink / raw)
  To: Dimitri Torfs; +Cc: linux-mips

On Wed, 21 Jan 2004, Dimitri Torfs wrote:

> Compiler choked on the first file it tries to compile: gcc added
> -mips1 automatically to the as command line which conflicts with the
> -Wa,--trap option:
> 
> /usr/local/lib/gcc-lib/mips-linux/3.2.2/../../../../mips-linux/bin/as
>  -G 0 -O2 -g0 -32 -march=r4100 -v -mips1 -non_shared -32 -march=r4100
>  --trap -o scripts/.tmp_empty.o -
> Assembler messages:
> Error: trap exception not supported at ISA 1
> 
> Removing the line which unsets the gas_isa option makes it work again:
> /usr/local/lib/gcc-lib/mips-linux/3.2.2/../../../../mips-linux/bin/as
> -G 0 -O2 -g0 -32 -march=r4100 -v -mips1 -non_shared -32 -march=r4100
> -mips3 --trap -o scripts/.tmp_empty.o

 Thanks for digging into it.  Actually after fixing the typos I've noticed
gcc 2.95.4 always implies the ISA from the ABI unless overridden and
-mabi=64 implies -mips4, so it bails out with -march/-mcpu set to
something like r4600.  This also proves the uncertainity about what's
passed to gas and so far including an ISA specification in gas settings is
tolerable if carefully chosen.  So here's a set of new updates -- now the
ISA specifier is removed from gcc flags only if it actually works and the
ISA specifier for gas is untouched.

 Hopefully this is the last attempt.  Please try it.

  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-8
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-21 23:53:31.000000000 +0000
@@ -98,6 +98,11 @@ while :; do \
 	gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
 	break; \
 done; \
+if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
+	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+		-xc /dev/null > /dev/null 2>&1 && \
+		gcc_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-21 23:53:25.000000000 +0000
@@ -37,7 +37,7 @@ endif
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
 GCCFLAGS	:= -I $(TOPDIR)/include/asm/gcc
-GCCFLAGS	+= -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
+GCCFLAGS	+= -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
 GCCFLAGS	+= $(call check_gcc, -finline-limit=100000,)
 LINKFLAGS	+= -G 0 -static # -N
 MODFLAGS	+= -mlong-calls
@@ -76,6 +76,7 @@ while :; do \
 	done; \
 	break; \
 done; \
+gcc_abi=-mabi=64; \
 gcc_cpu=$$cpu; gcc_isa=$$isa; \
 gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
 while :; do \
@@ -87,7 +88,12 @@ while :; do \
 	gas_opt=; gas_cpu=; gas_isa=; \
 	break; \
 done; \
-echo $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
+if test "$$gcc_opt" = -march=; then \
+	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+		-xc /dev/null > /dev/null 2>&1 && \
+		gcc_isa=; \
+fi; \
+echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
 
 #
 # CPU-dependent compiler/assembler options for optimization.

patch-mips-2.6.0-20040108-mabi-8
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-21 23:53:58.000000000 +0000
@@ -108,9 +108,14 @@ while :; do \
 	gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
 	break; \
 done; \
-if test x$(gcc-abi) != x$(gas-abi); then \
+if test "$(gcc-abi)" != "$(gas-abi)"; then \
 	gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
 fi; \
+if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
+	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+		-xc /dev/null > /dev/null 2>&1 && \
+		gcc_isa=; \
+fi; \
 echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu $$gas_isa)
 
 #

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-22 16:10             ` Maciej W. Rozycki
@ 2004-01-25 19:17               ` Dimitri Torfs
  2004-01-26 18:08                 ` Maciej W. Rozycki
  0 siblings, 1 reply; 15+ messages in thread
From: Dimitri Torfs @ 2004-01-25 19:17 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips

On Thu, Jan 22, 2004 at 05:10:23PM +0100, Maciej W. Rozycki wrote:
> 
>  Thanks for digging into it.  Actually after fixing the typos I've noticed
> gcc 2.95.4 always implies the ISA from the ABI unless overridden and
> -mabi=64 implies -mips4, so it bails out with -march/-mcpu set to
> something like r4600.  This also proves the uncertainity about what's
> passed to gas and so far including an ISA specification in gas settings is
> tolerable if carefully chosen.  So here's a set of new updates -- now the
> ISA specifier is removed from gcc flags only if it actually works and the
> ISA specifier for gas is untouched.
> 
>  Hopefully this is the last attempt.  Please try it.
> 

Ok for me (tested the HEAD one).

Dimitri


-- 
Dimitri Torfs       |  NSCE 
dimitri@sonycom.com |  The Corporate Village
tel: +32 2 7008541  |  Da Vincilaan 7 - D1 
fax: +32 2 7008622  |  B-1935 Zaventem - Belgium

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Support for newer gcc/gas options
  2004-01-25 19:17               ` Dimitri Torfs
@ 2004-01-26 18:08                 ` Maciej W. Rozycki
  0 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2004-01-26 18:08 UTC (permalink / raw)
  To: Dimitri Torfs, Ralf Baechle; +Cc: linux-mips

On Sun, 25 Jan 2004, Dimitri Torfs wrote:

> >  Thanks for digging into it.  Actually after fixing the typos I've noticed
> > gcc 2.95.4 always implies the ISA from the ABI unless overridden and
> > -mabi=64 implies -mips4, so it bails out with -march/-mcpu set to
> > something like r4600.  This also proves the uncertainity about what's
> > passed to gas and so far including an ISA specification in gas settings is
> > tolerable if carefully chosen.  So here's a set of new updates -- now the
> > ISA specifier is removed from gcc flags only if it actually works and the
> > ISA specifier for gas is untouched.
> > 
> >  Hopefully this is the last attempt.  Please try it.
> 
> Ok for me (tested the HEAD one).

 Thanks.  Ralf, OK to apply these?

-- 
+  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-8
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-21 23:53:31.000000000 +0000
@@ -98,6 +98,11 @@ while :; do \
 	gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
 	break; \
 done; \
+if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
+	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+		-xc /dev/null > /dev/null 2>&1 && \
+		gcc_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-21 23:53:25.000000000 +0000
@@ -37,7 +37,7 @@ endif
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
 GCCFLAGS	:= -I $(TOPDIR)/include/asm/gcc
-GCCFLAGS	+= -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
+GCCFLAGS	+= -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
 GCCFLAGS	+= $(call check_gcc, -finline-limit=100000,)
 LINKFLAGS	+= -G 0 -static # -N
 MODFLAGS	+= -mlong-calls
@@ -76,6 +76,7 @@ while :; do \
 	done; \
 	break; \
 done; \
+gcc_abi=-mabi=64; \
 gcc_cpu=$$cpu; gcc_isa=$$isa; \
 gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
 while :; do \
@@ -87,7 +88,12 @@ while :; do \
 	gas_opt=; gas_cpu=; gas_isa=; \
 	break; \
 done; \
-echo $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
+if test "$$gcc_opt" = -march=; then \
+	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+		-xc /dev/null > /dev/null 2>&1 && \
+		gcc_isa=; \
+fi; \
+echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
 
 #
 # CPU-dependent compiler/assembler options for optimization.


patch-mips-2.6.0-20040108-mabi-8
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-21 23:53:58.000000000 +0000
@@ -108,9 +108,14 @@ while :; do \
 	gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
 	break; \
 done; \
-if test x$(gcc-abi) != x$(gas-abi); then \
+if test "$(gcc-abi)" != "$(gas-abi)"; then \
 	gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
 fi; \
+if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
+	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+		-xc /dev/null > /dev/null 2>&1 && \
+		gcc_isa=; \
+fi; \
 echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu $$gas_isa)
 
 #

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-01-26 18:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-23 11:46 Support for newer gcc/gas options Dimitri Torfs
2003-12-23 12:05 ` Maciej W. Rozycki
2004-01-09 22:01   ` Dimitri Torfs
2004-01-10  1:19     ` Thiemo Seufer
2004-01-10  8:03       ` Dimitri Torfs
2004-01-20 12:37   ` Maciej W. Rozycki
2004-01-20 12:45     ` Thiemo Seufer
2004-01-20 12:59       ` Maciej W. Rozycki
2004-01-20 20:40     ` Dimitri Torfs
2004-01-21 14:09       ` Maciej W. Rozycki
2004-01-21 14:51         ` Dimitri Torfs
2004-01-21 18:35           ` Dimitri Torfs
2004-01-22 16:10             ` Maciej W. Rozycki
2004-01-25 19:17               ` Dimitri Torfs
2004-01-26 18:08                 ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.