This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Cross Compile to make a Native Compiler
- From: "Daniel Laird" <danieljlaird at hotmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 25 Feb 2002 13:24:47 +0000
- Subject: Cross Compile to make a Native Compiler
- Bcc:
Hello everyone.
I am trying to make a native mips-linux compiler. I have a cross compiler
which runs on intel-linux so i thought i could try to cross compile the
cross compiler to make a native compiler. Has anyone done this?
I can configure using the following line
../combined-src/configure --target=mipsel-linux --host=mipsel-linux
--prefix=/export/home/laird/phoenix_toolchain/native/mips-tools-
3.0.2/ --enable-languages=c,c++ --with-gnu-as --with-gnu-ld -v
this builds the links for a native mips compiler.
I also have to set environmental variables as follows
export CC_FOR_BUILD="gcc"
export CXX_FOR_BUILD="gcc"
export CC="mipsel-linux-gcc"
export
CC_FOR_TARGET="/export/home/laird/phoenix_toolchain/cross/combined-build/gcc/xgcc
-B/export/home/laird/phoenix_toolchain/cros
s/combined-build/gcc/ -isystem
/export/home/laird/phoenix_toolchain/native/mips-tools-3.0.2/mipsel-linux/sys-include"
export GCC_FOR_TARGET="$CC_FOR_TARGET"
export CC_FOR_TARGET="$CC_FOR_TARGET"
export CXX_FOR_TARGET="$CC_FOR_TARGET"
export AS_FOR_TARGET="mipsel-linux-as"
export LD_FOR_TARGET="mipsel-linux-ld"
export NM_FOR_TARGET="mipsel-linux-nm"
export AR_FOR_TARGET="mipsel-linux-ar"
export RANLIB_FOR_TARGET="mipsel-linux-ranlib"
export
PATH=/export/home/laird/phoenix_toolchain/cross/mips-tools-3.0.2/bin:$PATH
CC=mipsel-linux-gcc
This looks like ti could work but when generating gencodes it builds for the
wrong architecture(mips execuatble) If i hack the makefile to solve this
problem later on it wants files to be mips so that it can link them.
Has anyone ever managed to make a native compiler using a cross compiler?
how did you do it?
Any help much appreciated.
Cheers
Dan
p.s I have tried the website http://www.objsw.com/CrossGCC/FAQ-4.html#ss4.9
and it helps but does not work.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.