want a,m,s,w,x when building gcc-3.1

Ralf Corsepius corsepiu@faw.uni-ulm.de
Sat Apr 27 23:23:00 GMT 2002


Am Sam, 2002-04-27 um 20.31 schrieb Jakub Jelinek:
> On Sat, Apr 27, 2002 at 09:17:51AM +0200, Ralf Corsepius wrote:
> > Hi,
> > 
> > When cross-building gcc-3.1/CVS for i386-rtems (elf) with vanilla
> > binutils-2.12, I am receiving hundreds of warnings similar to this:
> > 
> > /tmp/ccCDyO9T.s:2104: Warning: Unrecognized .section attribute: want
> > a,m,s,w,x
> > 
> > Any ideas what might be causing this?
> 
> This looks like you've configured gcc against binutils-2.12, but are using
> some older binutils to assemble/link.
Not really, but you seem to be right, indeed, xgcc seems be picking up
the wrong "as".

Some more details (Sorry, this has become lengthy):

Host: i686-linux, gcc-2.95.3 (SuSE), binutils-2.11.90.0.31
Target-sources: gcc-3-1-branch, newlib-cvs, binutils-2.12

1. Building binutils-2.12, installing to /opt/rtems
configure --target=i386-rtems --prefix=/opt/rtems
make; make install

2. Building gcc-3.1 with newlib copied into gcc's source-tree 

export PATH=/opt/rtems/bin:$PATH

2.1 Using the same prefix for gcc as for binutils

configure --target=i386-rtems --with-gnu-as --with-gnu-ld \
--with-newlib --with-threads=rtems '--enable-languages=c,c++' \
--prefix=/opt/rtems

No problem, everything builds.

2.2 Using a different prefix for gcc than for binutils

../gcc-3.1-branch/configure --target=i386-rtems \
--with-gnu-as --with-gnu-ld \
--with-newlib --with-threads=rtems \
'--enable-languages=c,c++' \
--prefix=/opt/test

make
... want a,m,s,w,x

3. Building for --target=sparc-rtems

3.1 Using the same prefix for gcc as for binutils.
No problems, building finishes correctly.

3.2 Using a different prefix for gcc as for binutils:
../gcc-3.1-branch/configure --target=sparc-rtems \
--with-gnu-as --with-gnu-ld \
--with-newlib --with-threads=rtems \
'--enable-languages=c,c++' \
--prefix=/opt/test
make
..
 /users/rtems/src/packages/BUILD/test/gcc/xgcc
-B/users/rtems/src/packages/BUILD/test/gcc/ -nostdinc
-B/users/rtems/src/packages/BUILD/test/sparc-rtems/newlib/ -isystem
/users/rtems/src/packages/BUILD/test/sparc-rtems/newlib/targ-include
-isystem
/users/rtems/src/packages/BUILD/gcc-3.1-branch/newlib/libc/include
-B/usr/local/sparc-rtems/bin/ -B/usr/local/sparc-rtems/lib/ -isystem
/usr/local/sparc-rtems/include -c -o crti.o -x assembler
../../gcc-3.1-branch/gcc/config/sparc/sol2-ci.asm
../../gcc-3.1-branch/gcc/config/sparc/sol2-ci.asm: Assembler messages:
../../gcc-3.1-branch/gcc/config/sparc/sol2-ci.asm:1: Warning: rest of
line ignored; first ignored character is `!'
../../gcc-3.1-branch/gcc/config/sparc/sol2-ci.asm:3: Warning: rest of
line ignored; first ignored character is `!'
...

=> The host's assembler seems to be picked up.

4. More tries for i386-rtems, playing with --with-[as|ld] and
[AS|LD]_FOR_TARGET

../gcc-3.1-branch/configure --target=i386-rtems \
--with-gnu-as --with-ld=/opt/rtems/i386-rtems/bin/as \
--with-gnu-ld --with-ld=/opt/rtems/i386-rtems/bin/ld \
--with-threads=rtems '--enable-languages=c,c++' \
--with-newlib --prefix=/opt/test
make
... want a,m,s,w,x

../gcc-3.1-branch/configure --target=i386-rtems \
--with-gnu-as --with-ld=/opt/rtems/bin/i386-rtems-as \
--with-gnu-ld --with-ld=/opt/rtems/bin/i386-rtems-ld \
--with-threads=rtems '--enable-languages=c,c++' \
--with-newlib --prefix=/opt/test
make
... want a,m,s,w,x

LD_FOR_TARGET=/opt/rtems/bin/i386-rtems-ld \
AS_FOR_TARGET=/opt/rtems/bin/i386-rtems-as \
../gcc-3.1-branch/configure --target=i386-rtems --with-gnu-as
--with-ld=/opt/rtems/i386-rtems/bin/as --with-gnu-ld
--with-ld=/opt/rtems/i386-rtems/bin/ld --with-threads=rtems
'--enable-languages=c,c++' --with-newlib --prefix=/opt/test
make
... want a,m,s,w,x

LD_FOR_TARGET=/opt/rtems/bin/i386-rtems-ld \
AS_FOR_TARGET=/opt/rtems/bin/i386-rtems-as \
../gcc-3.1-branch/configure --target=i386-rtems --with-gnu-as
--with-gnu-ld --with-threads=rtems '--enable-languages=c,c++'
--with-newlib --prefix=/opt/test
make
... want a,m,s,w,x

Nothing seems to work out as desired :(

Unless I am missing something, this indicates that
* gcc-3.1-cross-compilers can not be installed to a different prefix
than binutils,
* gcc-3.1's configuration probably is broken wrt. binutils-detection for
cross-compilers.

Anyway, IMHO, silently picking up the native "as" for building
cross-target-libs, as gcc-3.1 currently seems to be doing, is not "the
right thing to do", IMHO.

Ralf

PS.: Sorry for cross-posting to the gcc list, but I now think this topic
might be more appropriate there.




More information about the Binutils mailing list