public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Rupert Wood" <me@rupey.net>
To: "'Antonio Catani'" <antonio.catani@seceti.it>
Cc: <gcc-help@gcc.gnu.org>
Subject: RE: Cross Compiler
Date: Mon, 07 Jan 2002 10:07:00 -0000	[thread overview]
Message-ID: <616BE6A276E3714788D2AC35C40CD18D03A9DB@whale.softwire.co.uk> (raw)
In-Reply-To: <616BE6A276E3714788D2AC35C40CD18D2C4E1C@whale.softwire.co.uk>

Antonio Catani wrotes:

> Sparc system is so slow to compile kernel, so, my ix86 system is to
> fast, for this i would like build a cross compiler from ix86 linux
> system to sparc system.

I haven't had much luck building cross-compilers for sparc-linux (at
least from solaris), but here's the process: you need binutils and GCC
distributions, plus sparc-linux system includes and libraries. It sounds
like you already have a working sparc-linux system so you can just take
the last two from that: otherwise, you'll need to generate them from
glibc and the linux kernel source.

1. Copy the contents of /lib (but not subdirectories) and /usr/lib (but
not subdirectories) from your sparc-linux machine to a directory your
build machine.
2. Copy the whole /usr/include tree from your sparc-linux machine to a
directory on your build machine. Make sure you copy the contents of
/usr/include/asm and /usr/include/linux rather than just the symlinks!
3. Uncompress binutils and gcc into the same source tree. Whichever one
has the more recent include and libiberty files should take precedence.
You can do this a number of ways, including combining separate trees
using find and cpio (see http://gcc.gnu.org/simtest-howto.html) or just
untar them both into the same directory using symlinks, e.g.:

    fox:~/src$ mkdir toolchain
    fox:~/src$ ln -s toolchain binutils-2.11.2
    fox:~/src$ ln -s toolchain gcc-3.02
    fox:~/src$ bzip2 -cd binutils-2.11.2.tar.bz2 |tar xvf -
    fox:~/src$ bzip2 -cd gcc-3.02.tar.bz2 |tar xvf -

4. In an empty build directory, configure, build and install the
toolchain, e.g.:

    fox:~/build/sparc-linux$ ~/src/toolchain/configure \
    --prefix=<wherever> \
    --with-headers=<path to sparc-linux /usr/include copy> \
    --with-libs=<path to sparc-linux /lib copy> \
    --with-libs=<path to sparc-linux /usr/lib copy> \
    --enable-languages=c \
    --target=sparc-linux && make && make install

(I don't think you need C++ for the kernel, do you?) Beware that the
configure and install steps above will attempt to write to the prefix
tree, so you'll need appropriate permissions (or set prefix to a subdir
of your home directory.)

You now might have 'sparc-linux-gcc' and friends, so you can edit the
kernel makefile:

    ARCH=sparc
    CROSS-COMPILE=sparc-linux-

However, my build falls over because (I think) of a specs error: the new
sparc-linux linker tries to link in /lib/ld-linux.so even though this
belogs to the build system and not the target system. I'm no specs
wizard and I haven't had time to come up with a correct fix for this
yet. Hacking around that, the kernel build falls over because
'task_struct' doesn't seem to be defined, and I know even less about the
kernel sources to try and fix that one.

Good luck,
Rup.

       reply	other threads:[~2002-01-07 18:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <616BE6A276E3714788D2AC35C40CD18D2C4E1C@whale.softwire.co.uk>
2002-01-07 10:07 ` Rupert Wood [this message]
2002-09-10  2:28 cross compiler Qiang YiLiang
  -- strict thread matches above, loose matches on Subject: below --
2002-05-06 11:10 Wimberly Eddie Contr WRALC/LYSFR
2002-05-06 22:10 ` Frank Schaefer
2002-01-07  9:24 Cross Compiler Antonio Catani
2001-07-27 12:16 cross compiler Der Herr Hofrat
2001-07-28 20:25 ` Alexandre Oliva
2001-07-10  3:33 Cross compiler Richard Davies
2001-07-10 11:44 ` Alexandre Oliva
2000-01-03  5:44 David Toba
2000-04-01  0:00 ` David Toba
2000-01-03  5:44 David Toba
2000-04-01  0:00 ` David Toba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=616BE6A276E3714788D2AC35C40CD18D03A9DB@whale.softwire.co.uk \
    --to=me@rupey.net \
    --cc=antonio.catani@seceti.it \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).