One thing I will recommend is to write a shell script for building the cross-compiler, as it is something you may need to do more than once. While the process isn't excessively complicated, it is sufficiently involved that doing it manually is prone to errors.
I have two scripts, one for binutils and another for gcc, which I use to update and build not just a single instance but several, to allow me to target several different architectures. However, not only am I building more than most people would need, I am also drawing directly from the development repos, which can be a dicey proposition. You may want to write a script or scripts which suit your own needs better than mine would. I'll attach mine so you can go over them, but I would advise against using them as-is.
update-binutils.sh
Code: Select all
#!/bin/bash
HOME_DIR="/home/schol-r-lea"
BINUTILS_SRC="$HOME_DIR/Deployments/cross-dev-utils/binutils-gdb"
BINUTILS_BUILD="$BINUTILS_SRC/build"
DEST="$HOME_DIR/opt/cross"
cd $BINUTILS_SRC
git pull origin master
cd $BINUTILS_BUILD
for TARGET in "i686-elf" "x86_64-elf" \
"arm-none-eabi" "aarch64-none-elf" \
"riscv32-unknown-elf" "riscv64-unknown-elf" \
"mipsel" "mips64el"
do
TARGET_DIR="$BINUTILS_BUILD/$TARGET"
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
make distclean
cd $TARGET_DIR
$BINUTILS_SRC/configure --target=$TARGET --prefix=$DEST --with-sysroot --disable-nls --disable-werror
make
make install
done
update-gcc.sh
Code: Select all
#!/bin/bash
GCC_SRC="/home/schol-r-lea/Deployments/cross-dev-utils/gcc"
GCC_BUILD="$GCC_SRC/build"
DEST="/home/schol-r-lea/opt/cross"
cd $GCC_SRC
git pull origin master
cd $GCC_BUILD
for TARGET in "i686-elf" "x86_64-elf" \
"arm-none-eabi" "aarch64-none-elf" \
"riscv32-unknown-elf" "riscv64-unknown-elf" \
"mipsel" "mips64el"
do
TARGET_DIR="$GCC_BUILD/$TARGET"
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
cd $TARGET_DIR
$GCC_SRC/configure --target=$TARGET --prefix=$DEST --disable-nls \
--enable-languages=objc,c,d,c++,go \
--without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
done
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.