This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cross compilation linker error


abhijit ray wrote:
> 
> I know this question has been discussed many times in many cross compilation lists
> but I am still confused .. also I would like to get pointers to some good links to
> do a RTFM
> 
> I have configured gcc for ARM ,FUJITSU-SPARCLITE etc
> the installation went fine
> and also the glibc

 The 'FAQ' in the glibc-sources would be fine for the RTFM...

> when i try compiling
> 
> [ary@avix tmp]$ arm-elf-gcc -o hello hello.c -I $ARMGINC -L $ARMGLIB
> /tools1/H-i686-pc-linux-gnu/lib/gcc-lib/arm-elf/3.0.4/../../../../arm-elf/bin/ld:
> cannot open crt0.o: No such file or directory
> collect2: ld returned 1 exit status
> 
> I cant find any crt0.o file in the lib directory there were only
> 
> crt1.o , crti.o ,crtn.o and gcrt1.o

 The 'arm-elf' configuration expects one using 'newlib' as the C-library, not 'glibc'.
'Newlib' provides the 'crt0.o' and its default 'target' with 'arm-elf' is the 'Demon'
(perhaps 'Angel' now, because some weird cult demanded this ;-) ARM-monitor on the
board...

 What in the hell the 'glibc' for 'arm-elf' will target, should the FAQ in the glibc-
sources tell... Basically you should have known why you wanted to use glibc as the
C-library, not newlib, before building the C-library, so please tell this to us all,
at least I'm curious about what the 'ARM standalone systems' means :

------------------------- clip ---------------------------------------------------- 
1.1.	What systems does the GNU C Library run on?

{UD} This is difficult to answer.  The file `README' lists the architectures
GNU libc was known to run on *at some time*.  This does not mean that it
still can be compiled and run on them now.

The systems glibc is known to work on as of this release, and most probably
in the future, are:

	*-*-gnu			GNU Hurd
	i[3456]86-*-linux-gnu	Linux-2.x on Intel
	m68k-*-linux-gnu	Linux-2.x on Motorola 680x0
	alpha*-*-linux-gnu	Linux-2.x on DEC Alpha
	powerpc-*-linux-gnu     Linux and MkLinux on PowerPC systems
	sparc-*-linux-gnu	Linux-2.x on SPARC
	sparc64-*-linux-gnu	Linux-2.x on UltraSPARC
	arm-*-none		ARM standalone systems
	arm-*-linux		Linux-2.x on ARM
	arm-*-linuxaout		Linux-2.x on ARM using a.out binaries
	mips*-*-linux-gnu	Linux-2.x on MIPS
------------------------- clip ---------------------------------------------------- 

> when i make the object hello.o file and try to link it
> i get this error
> 
> [ary@avix tmp]$ arm-elf-ld -o hello hello.o -I $ARMGINC -L $ARMGLIB -lc
> /libx/glibc/arm/lib/libc.so.6: could not read symbols: Invalid operation

 The 'arm-linux-gnu' target uses the 'libc.so.6' as the name for the shared run-time
C-library...

> Can anyone help or give some good links .. my search in google wasn't particularly helpful

 Normally people use newlib for the 'ARM standalone systems' and 'glibc', 'uclib' etc. for
the Linux/ARM, uCLinux/ARM, so please tell us more about your aims with 'glibc'...

 Basically it isn't difficult to edit your 'specs' etc. and let your compiler to use the
(probably) PIC-mode 'crt1.o', 'crti.o' and 'crtn.o' as the startups and to link against
the shared 'libc.so.6' for 'something', but first there must be some sanity and the 'something'
must be known...  If your aim is to build cross-tools for Linux/ARM, please do that, and don't
try the standalone 'arm-elf' for embedded boards with the 'Angel'-monitor or something. And
with the standalone ARM-targets the 'newlib' is a better choice, especially if not yet knowing
for which purpose the 'glibc' will be needed...

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]