diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-14 15:13:02 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-14 15:13:02 +0200 |
commit | f31f7960bd260cb90ffdd766393d51bd85a547d1 (patch) | |
tree | 6a9404909186c22c6bc989624b2488830e50e64e /README.CrossCompiling | |
parent | 36bc53591247bbd16e42bbf7d5d4744a5416dfa8 (diff) | |
download | abaos-f31f7960bd260cb90ffdd766393d51bd85a547d1.tar.gz abaos-f31f7960bd260cb90ffdd766393d51bd85a547d1.tar.bz2 |
removed stddef.h and limits.h (come with the compiler header files)
added a stub stdint.h (only sometimes comes with the compiler)
added a guide on cross compiling
adapted to cross compilation, for now tcc works
Diffstat (limited to 'README.CrossCompiling')
-rw-r--r-- | README.CrossCompiling | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/README.CrossCompiling b/README.CrossCompiling new file mode 100644 index 0000000..67b5957 --- /dev/null +++ b/README.CrossCompiling @@ -0,0 +1,138 @@ +Intro +----- + +You can compile AbaOS from a 32-bit host or chroot (e.g. Arch32 chroot). +But you have to be extremly careful nothing from the host creeps into +the binaries. + +You can also create a cross-compilation environment. Not, we don't need +a full fledged chain, linker and compiler is enough. AbaOs has a small +integrated C library which is sufficient to build the kernel. + +gcc +--- + +mkdir -p $HOME/cross-compilers/gcc +cd $HOME/cross-compilers/gcc +wget https://ftp.gnu.org/gnu/binutils/binutils-2.28.tar.gz +tar xf binutils-2.28.tar.gz +mkdir binutils-build +cd binutils-build +../binutils-2.28/configure --target=i486-elf --prefix=$HOME/cross-compilers --disable-nls -v +make all +make check +make install +cd .. + +wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz +tar xf gmp-6.1.2.tar.lz +mkdir gmp-build +cd gmp-build +../gmp-6.1.2/configure --build=i486-elf --host=i486-elf --prefix=$HOME/cross-compilers +make all +make check +make install +cd .. + +wget http://www.mpfr.org/mpfr-current/mpfr-3.1.5.tar.gz +tar xf mpfr-3.1.5.tar.gz +mkdir mpfr-build +cd mpfr-build +../mpfr-3.1.5/configure -build=i486-elf --host=i486-elf --prefix=$HOME/cross-compilers \ + --with-gmp=$HOME/cross-compilers +make all +make check +make install +cd .. + +wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz +tar xf mpc-1.0.3.tar.gz +mkdir mpc-build +cd mpc-build +../mpc-1.0.3/configure --host=i486-elf --target=i486-elf \ + --prefix=$HOME/cross-compilers \ + --with-gmp=$HOME/cross-compilers \ + --with-mpfr=$HOME/cross-compilers +make all +make check +make install +cd .. + +wget ftp://ftp.mpi-sb.mpg.de/pub/gnu/mirror/gcc.gnu.org/pub/gcc/releases/gcc-7.1.0/gcc-7.1.0.tar.gz +tar zxf gcc-7.1.0.tar.gz +mkdir gcc-build +cd gcc-build +../gcc-7.1.0/configure --target=i486-elf --prefix=$HOME/cross-compilers \ + --with-gnu-as --with-gnu-ld \ + --disable-nls --enable-languages=c --disable-libgcj --without-headers \ + --with-gmp=$HOME/cross-compilers \ + --with-mpfr=$HOME/cross-compilers \ + --with-mpc=$HOME/cross-compilers +make all-gcc +make all-target-libgcc +make install-gcc +make install-target-libgcc + +tcc +--- + +mkdir -p $HOME/cross-compilers/tcc +cd $HOME/cross-compilers/tcc +wget https://ftp.gnu.org/gnu/binutils/binutils-2.28.tar.gz +tar xf binutils-2.28.tar.gz +mkdir binutils-build +cd binutils-build +../binutils-2.28/configure --target=i486-elf --prefix=$HOME/cross-compilers --disable-nls -v +make all +make check +make install +cd .. + +mkdir -p $HOME/cross-compilers/tcc +cd $HOME/cross-compilers/tcc +git clone git://repo.or.cz/tinycc.git +cd tinycc +./configure --cpu=i386 --enable-cross --prefix=$HOME/cross-compilers +make +cd .. + +setenv PATH "${PATH}:$HOME/cross-compilers" +make clean all CC=i386-tcc LD=i486-elf-ld + +pcc +--- + +mkdir -p $HOME/cross-compilers/pcc +cd $HOME/cross-compilers/pcc +wget https://ftp.gnu.org/gnu/binutils/binutils-2.28.tar.gz +tar xf binutils-2.28.tar.gz +mkdir binutils-build +cd binutils-build +../binutils-2.28/configure --target=i486-unknown-linux-gnu --prefix=$HOME/cross-compilers --disable-nls -v +make all +make check +make install +cd .. + +mkdir -p $HOME/cross-compilers/pcc +cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc-libs +mkdir pcc-libs-build +cd pcc-libs-build +../pcc-libs/configure --target=i486-unknown-linux-gnu --prefix=$HOME/cross-compilers +make +make install +cd .. + +cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc +mkdir pcc-build +cd pcc-build +../pcc/configure --target=i486-unknown-linux-gnu --prefix=$HOME/cross-compilers +make +make install + +Links +----- + +https://ftp.gnu.org/gnu/binutils/ +http://wiki.osdev.org/Target_Triplet +http://wiki.osdev.org/GCC_Cross-Compiler |