From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5234 invoked by alias); 7 Jan 2002 18:07:06 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 5204 invoked from network); 7 Jan 2002 18:07:05 -0000 Received: from unknown (HELO anchor-post-32.mail.demon.net) (194.217.242.90) by sources.redhat.com with SMTP; 7 Jan 2002 18:07:05 -0000 Received: from mailgate.softwire.co.uk ([62.49.203.138] helo=polarbear) by anchor-post-32.mail.demon.net with esmtp (Exim 2.12 #1) id 16NeAq-000Arb-0W; Mon, 7 Jan 2002 18:07:04 +0000 From: "Rupert Wood" To: "'Antonio Catani'" Cc: Subject: RE: Cross Compiler Date: Mon, 07 Jan 2002 10:07:00 -0000 Message-ID: <616BE6A276E3714788D2AC35C40CD18D03A9DB@whale.softwire.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <616BE6A276E3714788D2AC35C40CD18D2C4E1C@whale.softwire.co.uk> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-SW-Source: 2002-01/txt/msg00059.txt.bz2 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= \ --with-headers= \ --with-libs= \ --with-libs= \ --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.