This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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: Compiling arm-gcc on x86-64 host


22.1.2013 15:04, Gyorgy Kovesdi kirjoitti:
I have 64-bit Suse (with gcc-4.7.1), and tried to build a Arm cross gcc:

binutils:
../../binutils-2.23.1/configure --target=arm-none-linux-gnueabi
make
make install

gcc:
../../gcc-4.7.2/configure --target=arm-none-linux-gnueabi --enable-multilib --disable-libssp --enable-languages=c,c++
make

I got the following error message:

/usr/local/arm-none-linux-gnueabi/bin/ar  rc libgcc_eh.a $objects
/usr/local/arm-none-linux-gnueabi/bin/ranlib libgcc_eh.a
/usr/local/arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory
/usr/local/arm-none-linux-gnueabi/bin/ld: cannot find -lc
/usr/local/arm-none-linux-gnueabi/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

It seems that the linker is not operational. I tried it on some older versions, the result is the same.
I found similar reports on the net, but those are related to older versions, and seems already resolved.

This is very basical with a C compiler - it requires a C library for the target system, in your case
a C library for 'arm-none-linux-gnueabi', whatever you mean with this name ! When making
the GCC helper library, 'libgcc*' parts, especially the shared 'libgcc_s.so', the existing target
C library parts would be required. This is the expectation in a GCC build for a system target,
a target which has the native GCC as its default GCC type. Linux is a system target, not an
embedded target which doesn't know a native GCC for it!


If your target name would be something like 'arm-tizen-linux-gnueabi', 'arm-meego-linux-gnueabi',
'arm-debian-linux-gnueabi' etc., meaning making GCC for some existing 'arm-linux-gnueabi'
system, then you would know where the "right" pre-made C library, here 'glibc', for your target
system would be. Systems like Tizen, MeeGo and Debian are real and existing and even have
native GCCs for them already...


The "right" is the key word because people have very narrow attitudes related to this subject,
equivalent to trying to drive with bare wheels without any tyres if they yet haven't the RIGHT brand
of tyres for their just bought car! Maybe you are one of these guys :-(


The simple solution is to accept ANY of the pre-made arm-linux-gnueabi systems to give the
required target C library when making your GCC for your own "None" system. And after the
GCC build being succeeded, building your own glibc for your own "None" system, replacing
the temporary "only suitable but not ther right" glibc in the crosstoolchain!


The hard solution is then that "drive with bare wheels to the tyre shop" approach. There are
scripts for these attitude problem people who cannot use a pre-made hammer when making
a hammer, a pre-made native GCC when making a native GCC etc. With Google you will
find them...




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