FENIX_main/dev_tools/build_util_src
Kat R. 4a16d95d0f Moved cross-compiler to ~/opt not ~/opt-test 2021-06-13 17:40:52 -05:00
..
cross_compiler_test Initial commit 2021-01-31 14:08:26 -06:00
README Initial commit 2021-01-31 14:08:26 -06:00
build_cross_compiler.sh Moved cross-compiler to ~/opt not ~/opt-test 2021-06-13 17:40:52 -05:00

README

This script automatically builds the cross-compiler needed to build FENIX at
this stage in time. It sets up a cross-compiler for i686-elf in ~/opt/cross.

This version of the script, suitable for building current, unversioned
pre-releases of FENIX, uses GCC 9.2.0 and Binutils 2.32. You'll need to
download these from the GNU website:
    Binutils: https://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.xz
    GCC: https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz
Download these tarballs into the same folder as build_cross_compiler.sh

Additionally, you'll need the following:
    - A suitable C compiler (probably GCC)
    - make
    - Bison
    - Flex
    - GMP
    - MPC
    - MPFR
    - Texinfo

These correspond to these Fedora packages:
    - gcc (or whatever C compiler you use, like Clang)
    - make
    - bison
    - flex
    - gmp-devel
    - libmpc-devel
    - mpfr-devel
    - texinfo

Once you're ready, simply run build_cross_compiler.sh. (You may first need
to run `chmod +x build_cross_compiler.sh` in order to make it executable.

Once done, you'll probably want to add ~/opt/cross/bin to your PATH. You'll
probably also want to verify that it worked. To do so, you can start by
checking if it runs using:
    `i686-elf-gcc --version`
You can also try compiling a small test kernel included in cross_compiler_test.
Simply run `make`. If everything worked, it should successfully compile. You can
then run `make test` to open the kernel in QEMU. (Note: You'll need
qemu-system-i386 to test the test kernel.