User:Imate900/GDC Cross-Compiler-Part2: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
== Step 2 - Native Compiler ==
== Step 2 - Native Compiler ==


Once you port [[Newlib]] to your OS (and install it to /usr/native), support ELF, and configure the packages to your OS, you may now do a native build of gdc to your OS.
Once you do everything in [[Porting Newlib]] to your OS (and install it to /usr/native), support ELF, and configure the packages to your OS, you may now do a native build of gdc to your OS.


Prepare for the build:
Prepare for the build:

Revision as of 20:29, 23 April 2009

Step 2 - Native Compiler

Once you do everything in Porting Newlib to your OS (and install it to /usr/native), support ELF, and configure the packages to your OS, you may now do a native build of gdc to your OS.

Prepare for the build:

   export PREFIX=/usr/native
   export TARGET=i586-elf
   export HOST=i586-elf
   cd /usr/src

mkdir build-native build-native/binutils build-native/gcc

binutils

   cd /usr/src/build-native/binutils
   /usr/src/binutils-x.xx/configure --build=`./config.guess` --target=$TARGET --prefix=$PREFIX --host=$HOST --disable-nls
   make all
   make install

gcc

   cd /usr/src/build-native/gcc
   /usr/src/gcc-x.x.x/configure --build=`./config.guess` --host=$HOST --target=$TARGET --prefix=$PREFIX --disable-nls \
       --enable-languages=c,d,c++ --with-headers=/usr/native
   make all-gcc
   make install-gcc

Your native toolchain is now ready in /usr/native!

This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.