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: How can I build gcc for arm on a x86_64 machine?


Vladimir Simonov wrote:

YueGuang wrote:
å 2008-10-29äç 10:06 +0000ïAndrew Haleyåéï
hi,
Hmm, you're not building with an ARM sysroot.  It's not just the headers
you need but the entire tree of the installed target OS.

Have you tried http://kegel.com/crosstool/? Build cross tool chain from scratch (with glibc/kernel rebuild) is quite tricky and crosstool provides most of the tricks.

If one has this "absolutely from scratch" attitude then :( Otherwise the "easy as a pie" method (which Andrew suggested) is to start with an existing target system like Debian/ARM, to use its prebuilt glibc and build the first GCC with it. After that one can produce one's own "custom" glibc and maybe one's own "custom" GCC with the self-made custom glibc - YueGuang's first GCC configure command really didn't include many "customize" options which Andrew's configure command then had...

Ok, I thought to try this "easy as a pie" method myself... The current
Debian glibc-2.7 for 'arm-linux' told in its 'libc-2.7.so' (seen with
'strings libc-2.7.so | less' in the '$sysroot/lib' and searching for
"GNU C Library") :

----------------- clip --------------------
GNU C Library stable release version 2.7, by Roland McGrath et al.
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.3.2.
Compiled on a Linux >>2.6.18-6-iop32x<< system on 2008-10-13.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        Support for some architectures added on, not maintained in
glibc core.
        BIND-8.2.3-T5B
----------------- clip --------------------

I would assume that "iop32x" being some ARM platform, so the glibc
was built natively on October 13...

After installing the current Linux binutils-2.19.50.0.1 (ftp.kernel.org)
for 'arm-debian-linux' target and installing the prebuilt Debian
glibc-2.7-15, the gcc-4.3.2 build for 'arm-debian-linux' really was that
"easy as a pie" process. No problems anywhere...  I too trusted the
defaults for the target to work so my GCC configure had only the minimal
options like '--enable-languages=c,c++' for creating only the C and C++
things. Maybe with some custom GCC options that 'generic ARM' (expected)
Debian glibc could have caused some problems - mixing 'hard-float'
binaries with 'soft-float' in ARM arch has been a problem for
instance...

If one doesn't aim to leave the project in this step (like I did), then
using some other target name like the generic 'arm-linux-gnu' or some
'arm-myown-linux' ('arm-vesuvius-linux'?), is the natural choice. In
any case things like those Debian Linux prebuilt glibcs are freely
available for almost all Linux-target toolchain "bootstraps"...

The "unexpected" problems may include :

 o one doesn't know how to unpack standard packages like '.tar.gz',
   '.tar.bz2', '.rpm', '.deb', '.zip' etc. For instance those '.deb'
   files are archives created with 'ar' and have the required stuff
   in a 'tarball' 'data.tar.gz'. So one does need to know how to use
   'ar' and 'tar' in order to unpack those '.deb' files :(

 o one doesn't know how to copy, how to create directories (that
   $sysroot where to unpack the stuff, for instance) and so on :(

Not having those expected "basic skills" isn't at all rare among cross
GCC builders but whether these should be teached on maillist like
'gcc-help' is not that clear...

BTW, there may be one more still easier way to get a 'arm-linux'
targeted crosstoolchain for Linux/x86* hosts and that is downloading
a maintained one like that from :

http://www.scratchbox.org


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