Linux GCC 13.1.0 cross- and/or native- tool-chain for C and C++ (ADA, Fortran D and GO in native version only)
Scripts to build a linux-toolchain for:
- the latticeMicro32 (LM32 soft-core processor), languages: C, C++
- the Atmel Atmega Micro-controller series (AVR) e.g. for Arduino, languages: C, C++
- the Motorola 68000 family (m68k), languages: C, C++
- the native GCC compiler collection, languages: C, C++, ADA, Fortran, D, GO
-
Cloning this repository.
git clone https://github.com/UlrichBecker/gcc-toolchain-builder.github
-
Change in the following directory:
cd gcc-toolchain-builder
-
By default the toolchain will installed in the hidden directory
${HOME}/.local
If you desire the toolchain in a other directory, so you have to initialize the shell variable PREFIX.
E.g.:
export PREFIX=/path/to/my/toolchain
Otherwise you can omit this step. -
Invoke the shell-script for your desired tool-chain:
./build-lm32-toolchain.sh
for building a LM32 tool-chain
./build-avr-toolchain.sh
for building a AVR tool-chain
./build-m68k-toolchain.sh
for building a Motorola 68000 tool-chain
./build-native-toolchain.sh
for building a native tool-chain
This will take about 45 minutes to more than three hours depending of your computer, internet connection, chosen tool chain and chosen languages.
After this three respectively four steps the new toolchain is ready to use.
Building a linux-toolchain for Linux-ARM devices is in develop yet.
- Commandline downloader "wget". (Type
which wget
to check whether it's installed.) - Tape archiver "tar". (Type
which tar
to check whether it's installed.) - Native GCC toolchain, respectively naive C/C++ compiler. (Type
which gcc
to check whether it's installed.)
If you desire a other version of GCC or of its components, so you can change this in the file gcc_versions.conf
.
But in this case it could become to compatibility problems, so you have to spend time to try the best combination of versions.
Following link could help you finding the combination of correct versions: https://wiki.osdev.org/Building_GCC
If you have got trouble may be the following link could help you: https://wiki.osdev.org/GCC_Cross-Compiler
If you have installed the tool chain not in the standard directory e.g. /usr/bin/
,
and when you test the new tool chain so just actualize the environment variable PATH
:
export PATH=/path/to/my/toolchain/bin:$PATH
If you'll test a native tool chain, so you also complete the environment variable LD_LIBRARY_PATH
lib64/path/to/my/toolchain/lib64:/path/to/my/toolchain/lib:$LD_LIBRARY_PATH
before you run a application compiled by these tool chain.
To reduce the likely of trouble building a cross tool chain I recommend to build a native tool chain at first
(with build-native-toolchain.sh
) and build your desired cross tool chain by these native tool chain.