How to build a GCC and binutils for x64-pc-elf?
Posted: Fri Jul 21, 2006 6:36 am
The OSFAQ for this topic is confusing.
How do we use Cygwin to build a cross compiler for x64 systems on a 32-bit Cygwin system, and on a 64-bit Linux system?
There's a patch that needs to be applied to GCC 4.1.1, but it doesn't explain how to apply it. Binutils 2.17 doesn't need the patch apparently. What's this about preparation, with the note that there's more coming? So we should wait before attempting to build a clean x86_64-pc-elf cross compiler? ??? ???
And what of newlib? Why is this necessary? Is it only for running the compiler on the host system?
I've downloaded gcc-4.1.1 and binutils-2.17. Now I need to unpack and run configure within the build directories, and apply the patch to gcc-4.1.1 to get the target=x86_64-pc-elf:
mkdir /usr/cross
export PREFIX=/usr/cross
export TARGET=x86_64-pc-elf
cd /usr/src
mkdir build-binutils build-gcc
And for binutils:
cd /usr/src/build-binutils
../binutils-x.xx/configure --target=$TARGET --prefix=$PREFIX --enable-64-bit-bfd
make all install
And for GCC with the x86_64-pc-elf patches:
cd /usr/src/build-gcc
export PATH=$PATH:$PREFIX/bin
../gcc-x.x.x/configure --target=$TARGET --prefix=$PREFIX \
--disable-nls --enable-languages=c,c++ --with-newlib --without-headers
make all-gcc install-gcc
Is that all that's necessary? Is the bootstrap process necessary? And now how to use the new toolchain, just make sure that /usr/cross is in the $PATH first, so:
PATH=/usr/cross:$PATH
Like that?
Thanks for your help...
How do we use Cygwin to build a cross compiler for x64 systems on a 32-bit Cygwin system, and on a 64-bit Linux system?
There's a patch that needs to be applied to GCC 4.1.1, but it doesn't explain how to apply it. Binutils 2.17 doesn't need the patch apparently. What's this about preparation, with the note that there's more coming? So we should wait before attempting to build a clean x86_64-pc-elf cross compiler? ??? ???
And what of newlib? Why is this necessary? Is it only for running the compiler on the host system?
I've downloaded gcc-4.1.1 and binutils-2.17. Now I need to unpack and run configure within the build directories, and apply the patch to gcc-4.1.1 to get the target=x86_64-pc-elf:
mkdir /usr/cross
export PREFIX=/usr/cross
export TARGET=x86_64-pc-elf
cd /usr/src
mkdir build-binutils build-gcc
And for binutils:
cd /usr/src/build-binutils
../binutils-x.xx/configure --target=$TARGET --prefix=$PREFIX --enable-64-bit-bfd
make all install
And for GCC with the x86_64-pc-elf patches:
cd /usr/src/build-gcc
export PATH=$PATH:$PREFIX/bin
../gcc-x.x.x/configure --target=$TARGET --prefix=$PREFIX \
--disable-nls --enable-languages=c,c++ --with-newlib --without-headers
make all-gcc install-gcc
Is that all that's necessary? Is the bootstrap process necessary? And now how to use the new toolchain, just make sure that /usr/cross is in the $PATH first, so:
PATH=/usr/cross:$PATH
Like that?
Thanks for your help...