I did this recently for x86 -> s390, but the concepts should be similar. Hope this helps at all. O'Reilly's "Building Embedded Linux Systems" is very helpful with how to build a cross compiler toolchain. Most of this comes from that book and a few tweaks based upon problems encountered along the way.
Harold Grovesteen
TARGET=s390-linux
Build binutils: ../binutils-2.15.90.0.1/configure --target=$TARGET --prefix=$PREFIX --enable-64-bit-bfd make all make install
Create headers for glibc (from top of target Linux kernel root): make mrproper make ARCH=s390 CROSS_COMPILE=$TARGET- include/linux/version.h make ARCH=s390 CROSS_COMPILE=$TARGET- include/asm
Build gcc boot compiler: ../gcc-3.4.0/configure --target=$TARGET --prefix=$PREFIX --without-headers --with-newlib --enable-languages=c --disable-shared make all-gcc make install-gcc
Build glibc using boot gcc compiler: CC=s390-linux-gcc ../glibc-2.3.2/configure --host=$TARGET --prefix=/usr --enable-add-ons --with-headers=~/m390/tools/s390-linux/include make make install_root=~/m390/tools/s390-linux prefix="" install
Build full gcc compiler: ../gcc-3.4.0/configure --target=$TARGET --prefix=$PREFIX --with-headers=~/m390/tools/s390-linux/include --with-libs=~/m390/tools/s390-linux/lib --enable-languages=c,c++ make all make install
Mark Post wrote:
I'm trying to build a Linux-390 cross-compiler so that I can generate 64-bit executables on my 31-bit systems. I'm having real problems with that. I've looked at the documentation on the Linux/390 developerWorks site, Kris's document on the Sine Nomine site, and several other FAQs and HOWTOs on the web. Nothing seems to work for me. Either, I get an error about the compiler not being able to find pthread.h, or a whole bunch of errors about not being able to find things like stdio.h, errno.h, and others.
The ./configure step says that it is setting up a cross-compile environment, but I always run into one or the other of the above errors. Has anyone run into a similar problem that knows how to get around this? Or does someone have a step-by-step recipe that's worked _recently_ for them?
I'm using gcc-3.3.4, with glibc 2.3.2, and binutils 2.15.90.0.3. Any and all help will be appreciated.
Mark Post
---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390
---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390
