Skip to content

Latest commit

 

History

History
64 lines (52 loc) · 1.29 KB

File metadata and controls

64 lines (52 loc) · 1.29 KB

Installation tutorial :

Step 1:

for fedora :

sudo dnf install gcc gcc-c++ binutils make wget tar texinfo gmp-devel mpfr-devel libmpc-devel

for debian based :

sudo apt install gcc gcc-c++ binutils make wget tar mtools xorriso

for arch based :

sudo pacman -S gcc gcc-c++ binutils make wget tar

Step 2 :

install cross compiler

mkdir -p ~/opt/cross
cd ~/opt/cross
wget https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.gz
wget https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.gz
tar -xf binutils-2.41.tar.gz
tar -xf gcc-13.2.0.tar.gz
mkdir build-binutils build-gcc

it can take several minutes, be patient...

Step 3:

Build Binutils :

cd build-binutils
../binutils-2.41/configure --target=i686-elf --prefix=$HOME/opt/cross --with-sysroot --disable-nls --disable-werror
make -j$(nproc)
make install
cd ..

Build GCC:

cd build-gcc
../gcc-13.2.0/configure --target=i686-elf --prefix=$HOME/opt/cross --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc -j$(nproc)
make all-target-libgcc -j$(nproc)
make install-gcc
    make install-target-libgcc
cd ..

Step 4:

Adding Env Var :

echo 'export PATH="$HOME/opt/cross/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

to run the make u must install xorriso