A cross-compiler is a type of compiler that runs on one architecture or operating system (the host) but produces executable code for a different architecture or operating system (the target). This is in contrast to a native compiler, which compiles code for the same platform on which it runs.
To Setup the Cross-Compiler, we've created a Dockerfile
.
It can be built and ran with the run.sh
script or like this:
docker build . -t xcompiler && docker run -it xcompiler
TARGET="i386-elf"
/opt/cross/bin/$TARGET-gcc --version
# Or
/opt/cross/bin/i386-elf-gcc --version