======================================================================== Scripts to build cross-compilers and native compilers for ADA Based on the sources from AdaCore Version 01 June 2018 ======================================================================== All of this starts on a 64bit x86 machine. First make sure you have AdaCore GNAT 2016 installed and on your path which gnatmake gnatmake -v GNATMAKE GPL 2016 (20160515-49) Copyright (C) 1992-2016, Free Software Foundation, Inc. try "gnatmake --help" for more information. To start the process do: ./ada-build.sh > build.output 2>&1 Environment variables that make the build parallel export MAKEOPTS="-j8" After a time the script will finish and you'll end up with the compilers under /install/directory (the packages are also tarred for distribution). To use the compilers, set the path to /install/directory//bin. To run the process on arm 64-bit machines (aarch64), edit the 'ada-build.sh' script and remove the 'x86_64' argument from the build-tarballs.sh line. The line: ../extra/build-tarballs.sh $PREFIX musl ada x86_64 aarch64 Must be changed to: ../extra/build-tarballs.sh $PREFIX musl ada aarch64 Note ---- It is also possible to build an aarch64 to x86_64 cross compiler. To do so, change the line to: ../extra/build-tarballs.sh $PREFIX musl ada aarch64 x86_64 Note ---- The build-tarballs.sh script takes 4 required and N optional arguments. The first 4 arguments are; . The optional arguments are the machine names of the cross compilation targets. The process well take a long time if not parallel, it proceeds in a number of stages: 1) build a bootstrap compiler, this process will use the AdaCore compiler to build a compiler that can compile against musl C (but the bootstrap compiler itself still has some glibc) evry compile starts with building statically compiled binutils for the platform (ar, as etc) every compile of gcc takes 2 steps, first build a C compiler, then use that compiler to build musl C library then build the real compiler (with C,C++ and Ada support), compiled against the musl C library next with this gcc build gcc dependencies (mpfr, gmp etc) next with this gcc build the gprbuild tools the build takes place under 'build/build-bootstrap' 2) build a x86_64 cross-compiler this will give you a compiler that runs on x86_64 and can build x84_64 executables the build takes place under 'build/build-x86_64-musl-linux' the result will be under /install/dir/x86_64-musl-linux 3) build an aarch64 cross-compiler this will give you a compiler that runs on x86_64 and can build aarch64 executables the build takes place under 'build/build-aarch64-musl-linux' the result will be under /install/dir/aarch64-musl-linux 4) build x86_64 native compilers this will give you a compiler that runs on x86_64 and can build x86_64 executables (much like the cross compilers, but now without the triple x86_64-linux-musl- prefix) the build takes place under 'build/build-x86_64-musl-linux-native' the result will be under /install/dir/x86_64-musl-linux 5) build aarch64 native compilers this will give you a compiler that runs on aarch64 and can build aarch64 executables. the build takes place under 'build/build-aarch64-musl-linux-native' the result will be under /install/dir/aarch64-musl-linux