public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* arm big endian broken?
@ 2003-03-06 19:29 Josh Fryman
  2003-03-13 17:08 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Fryman @ 2003-03-06 19:29 UTC (permalink / raw)
  To: binutils


hi,

i'm trying to build a cross-hosting toolchain for armv5b (big endian
arm v5) on an i686 host.  it appears that binutils is broken in some
manner such that "ld" won't link together big-endian objects.  this
shows up for the first time in build glibc.  

if i re-run the command from gcc with -mbig-endian, it works fine.
it seems like the binutils are built for arm little-endian, not big-
endian.  this is a bug as far as i can see.

anyone have suggestions or advice?

thanks,

josh

------

the configuration commands used, and the error generated by glibc,
are as follows:

../binutils-2.13.90.0.18-src/configure --target=armv5b-linux --program-prefix=xscalebe- --prefix=/usr/local/xscalebe/ --with-cpu=xscale  --nfp

../gcc-3.2.2-src/configure --target=armv5b-linux --prefix=/usr/local/xscalebe/ i686-pc-linux-gnu --with-headers=/usr/local/xscale/src/linux-adi-brh//include --disable-shared --disable-threads --enable-languages=c --nfp --with-cpu=xscale  --without-fp --with-softfloat-support=internal --program-prefix=xscalebe-

CC=xscalebe-gcc ../glibc-2.3.2-src/configure --host=armv5b-linux --build=i686-pc-linux-gnu --with-headers=/usr/local/xscale/src/linux-adi-brh//include --enable-add-ons --enable-shared --prefix=/usr/local/xscalebe/ --with-cpu=xscale --without-fp --enable-kernel=2.4.19 --program-prefix=xscalebe-

[... glibc-building ]

xscalebe-gcc -nostdlib -nostartfiles -r -o /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/crt1.o /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/start.o /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/abi-note.o /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/init.o
/usr/local/xscalebe/bin/../lib/gcc-lib/armv5b-linux/3.2.2/../../../../armv5b-linux/bin/ld: /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/start.o: compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/start.o
/usr/local/xscalebe/bin/../lib/gcc-lib/armv5b-linux/3.2.2/../../../../armv5b-linux/bin/ld: /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/abi-note.o: compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/abi-note.o
/usr/local/xscalebe/bin/../lib/gcc-lib/armv5b-linux/3.2.2/../../../../armv5b-linux/bin/ld: /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/init.o: compiled for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/init.o
collect2: ld returned 1 exit status
make[2]: *** [/usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu/crt1.o] Error 1
make[2]: Leaving directory `/usr/local/xscale/toolchain/build/glibc-2.3.2-src/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/usr/local/xscale/toolchain/build/glibc-2.3.2-src'
make: *** [all] Error 2

cd /usr/local/xscale/toolchain/build/glibc-2.3.2-build/csu 

file *.o

abi-note.o:   ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
check_fds.o:  ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
dso_handle.o: ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
elf-init.o:   ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
errno-loc.o:  ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
errno.o:      ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
gmon-start.o: ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
init-first.o: ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
init.o:       ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
libc-start.o: ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
libc-tls.o:   ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
start.o:      ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
sysdep.o:     ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
version.o:    ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped

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

* Re: arm big endian broken?
  2003-03-06 19:29 arm big endian broken? Josh Fryman
@ 2003-03-13 17:08 ` Nick Clifton
  2003-03-13 17:41   ` Richard Earnshaw
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2003-03-13 17:08 UTC (permalink / raw)
  To: Josh Fryman; +Cc: binutils

Hi Josh,

> i'm trying to build a cross-hosting toolchain for armv5b (big endian
> arm v5) on an i686 host.  it appears that binutils is broken in some
> manner such that "ld" won't link together big-endian objects.  this
> shows up for the first time in build glibc.  
> 
> if i re-run the command from gcc with -mbig-endian, it works fine.
> it seems like the binutils are built for arm little-endian, not big-
> endian.  this is a bug as far as i can see.
> 
> anyone have suggestions or advice?

Well it is true that the binutils tools do not parse a configuration
target of "armv5b" as being a big-endian target, but normally this
should not matter.  Normally gcc will tell the linker to default to a
big-endian output by adding the -EB command line switch.

My guess would be that the specs file created for gcc are not passing
the -EB switch on to the linker.  You could have a look at the file to
confirm this, and assuming that it is missing, add it back in.

The proper fix of course would be to find out why it is not in the
specs file in the first place, but that looks more complicated.  From
a quick scan of the gcc sources I could not find where it actually
works out that "armv5b" is a big endian toolchain in the first place,
so I am not sure how/where the specs file should be modified.

Cheers
        Nick




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

* Re: arm big endian broken?
  2003-03-13 17:08 ` Nick Clifton
@ 2003-03-13 17:41   ` Richard Earnshaw
  2003-03-13 20:49     ` Josh Fryman
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Earnshaw @ 2003-03-13 17:41 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Josh Fryman, binutils, Richard.Earnshaw

> Hi Josh,
> 
> > i'm trying to build a cross-hosting toolchain for armv5b (big endian
> > arm v5) on an i686 host.  it appears that binutils is broken in some
> > manner such that "ld" won't link together big-endian objects.  this
> > shows up for the first time in build glibc.  
> > 
> > if i re-run the command from gcc with -mbig-endian, it works fine.
> > it seems like the binutils are built for arm little-endian, not big-
> > endian.  this is a bug as far as i can see.
> > 
> > anyone have suggestions or advice?
> 
> Well it is true that the binutils tools do not parse a configuration
> target of "armv5b" as being a big-endian target, but normally this
> should not matter.  Normally gcc will tell the linker to default to a
> big-endian output by adding the -EB command line switch.
> 
> My guess would be that the specs file created for gcc are not passing
> the -EB switch on to the linker.  You could have a look at the file to
> confirm this, and assuming that it is missing, add it back in.
> 
> The proper fix of course would be to find out why it is not in the
> specs file in the first place, but that looks more complicated.  From
> a quick scan of the gcc sources I could not find where it actually
> works out that "armv5b" is a big endian toolchain in the first place,
> so I am not sure how/where the specs file should be modified.

There are no gcc configurations that default to big-endian on ARM.

R.

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

* Re: arm big endian broken?
  2003-03-13 17:41   ` Richard Earnshaw
@ 2003-03-13 20:49     ` Josh Fryman
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Fryman @ 2003-03-13 20:49 UTC (permalink / raw)
  To: Richard.Earnshaw; +Cc: rearnsha, nickc, binutils

 
> There are no gcc configurations that default to big-endian on ARM.

right.  after posting here and finding a vacuum of information, i posted
to gcc the corresponding Q and you answered it for me there.  i should
have posted a follow-up here.

thanks,

josh

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

end of thread, other threads:[~2003-03-13 20:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-06 19:29 arm big endian broken? Josh Fryman
2003-03-13 17:08 ` Nick Clifton
2003-03-13 17:41   ` Richard Earnshaw
2003-03-13 20:49     ` Josh Fryman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).