I'm trying to build an older version of GCC toolchain for ARM under x86 because there is a bug with GCC > v5 for Cortex-M0. I'm following the combination of the following instructions:
So my overall procedure is as follows:
# Download GCC-5.5.0 from https://gcc.gnu.org/releases.html
VERSION="5.5.0"
tar xzf gcc-$VERSION.tar.gz
cd gcc-$VERSION
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
../gcc-5.5.0/configure --prefix=$HOME/embedded/gcc-arm-none-eabi-5.5.0 --disable-multilib --enable-languages=c,c++ --target=arm-none-eabi
make -j$(nproc) # use all cores
make install
Then the following files are created under ~/embedded/arm-none-eabi-5.5.0/bin/:
arm-none-eabi-c++ arm-none-eabi-gcc-5.5.0 arm-none-eabi-gcov
arm-none-eabi-cpp arm-none-eabi-gcc-ar arm-none-eabi-gcov-dump
arm-none-eabi-g++ arm-none-eabi-gcc-nm arm-none-eabi-gcov-tool
arm-none-eabi-gcc arm-none-eabi-gcc-ranlib
However, the following command fails:
arm-none-eabi-gcc -c -mcpu=cortex-m0 -O0 -ggdb (......)
Compiling crt0_v6m.S
as: unrecognized option '-mcpu=cortex-m0'
make: *** [/home/ceremcem/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/rules.mk:253: build/obj/crt0_v6m.o] Error 1
I can verify that the command uses newly produced binaries:
$ which arm-none-eabi-gcc
/home/ceremcem/embedded/arm-none-eabi-5.5.0/bin//arm-none-eabi-gcc
This means that the newly compiled GCC toolchain does not accept the mcpu option. What could be wrong with building the GCC toolchain phase that causes -mcpu=cortex-m0 option to fail?
asthat’s complaining, and that’s part of binutils../contrib/download_prerequisitescommand. Should I build something else?gcc-arm-none-eabiversion 5.4.1.