Build my own cross-compiler for non Linux Targets (MIPS, ARM, PPC)

Jay Kulpinski jay.kulpinski@gmail.com
Fri Dec 7 11:47:00 GMT 2007


On 12/5/07, Juju Mimi <migounet73@gmail.com> wrote:
>  Hi all.
> I would like to build my own cross-compiler.
> As the Host/Build plateform is an x86/Linux system, using gcc seems to
> be the best way to build a cross-compiler, doesn't it ?


yes.

> Ideally, there would be 3 different targets such as ARM, MIPS and
> PowerPC, without any running OS. Actually, I just would like to
> generate the relevant machine code for each target.
> The cross-compiler(s) are used in order to compile C language
> applications only (not for building a Linux kernel for instance, and
> no other language than C to support).
>
> + Does anybody know the procedure to build such a cross compiler, I
> mean how to directly compile to machine code?



Something along these lines will do it for the PowerPC.  Newer
versions may work as well.  It should be similar for the other
targets.

PREFIX=/opt/crossgcc
TARGET=powerpc-eabi
BINUTILS_VER=2.16.1
GCC_VER=3.4.4
NEWLIB_VER=1.13.0

tar xjf binutils-${BINUTILS_VER}.tar.bz2
mkdir build
cd build
../binutils-${BINUTILS_VER}/configure --prefix=$PREFIX --target=$TARGET
make
make install
cd ..
rm -rf binutils-${BINUTILS_VER} build
PATH=$PREFIX/bin:$PATH
tar xzf newlib-${NEWLIB_VER}.tar.gz
mv newlib-${NEWLIB_VER} gcc-${GCC_VER}
tar xjf gcc-core-${GCC_VER}.tar.bz2
mkdir build
cd build
../gcc-${GCC_VER}/configure --prefix=$PREFIX --target=$TARGET
make
make install
cd ..
rm -rf build gcc-${GCC_VER}


>  + Which C library would you advise me to use / What is the most
> suitable one for embedded systems among the newlib, glibc, uClib or
> any else?



newlib is best if you have no underlying OS.

> Any piece of information, advice or experience to share would be
> greatly appreciated.
> I hope not to bother you too much, I guess it must be a subject you've
> already dealt with.
>
> Thks a lot.
>
>
> Julian
>
> --
> For unsubscribe information see  http://sourceware.org/lists.html#faq
>
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list