Cannot build GCC for Cortex-M0

Andriy Sukhynyuk
Thu Sep 2 06:29:00 GMT 2010

Hi guys,

Sorry Ian, I was trying to narrow the case as much as possible. 

Actually, the trouble is that build process still generates ARM code even though 

it was configured with option --with-cpu=cortex-m0 and multilib disabled.

Alas, I managed to build GCC for the target using the following args:

../gcc-4.5.0/configure --target=arm-none-eabi --with-mode=thumb 
--with-cpu=cortex-m0 --prefix=/f/cross-gcc/4.5.0 --disable-nls --disable-shared 
--disable-threads --with-gcc --with-gnu-ld --with-gnu-as --with-dwarf2 
--enable-languages=c --disable-interwork --disable-multilib --with-newlib 
--disable-libssp --disable-libstdcxx-pch --disable-libmudflap --disable-libgomp 
--with-gmp=/f/cross-gcc/4.5.0 --with-mpfr=/f/cross-gcc/4.5.0 
--with-mpc=/f/cross-gcc/4.5.0 -v

Well, I would rather agree that it would have been silly to expect scripts to be 

as intelligent as to switch _default_ mode to thumb automatically by reading 
--with-cpu=cortex-m0 and --disable-multilib.

Here I must thank Richard for a hint which could spare me a day had I not 
laboriously worked it out alone :-(

Still I cannot figure out how to add Cortex-M0 support with multilib enabled. By 

default libraries for armv6-m are not built. I have to include interworking 
support as well. 

It looks like to build GCC with multilib enabled, one has to edit 
\gcc-4.5.0\gcc\config\arm\t-arm-elf file.

Well I spent yesterday and could not find how to do it. It all ends up in error 
trying to compile test file with -march=armv6-m but without -mthumb.

Is it possible to build multilib in one step or I should perform many builds and 
later copy libraries to appropritae folders?

----- Original Message ----
From: Ian Lance Taylor <>
To: Andriy Sukhynyuk <>
Sent: Tue, August 31, 2010 7:55:18 PM
Subject: Re: Cannot build GCC for Cortex-M0

Andriy Sukhynyuk <> writes:

> I have been trying to build cross toolchain for  Cortex-M0 (using MinGW/msys) 
> for quite a while with no success.
> I  tried to run configure with many different arguments. 
> Particularly I  am interested to know why the following line is successful for  
> strongarm1110 build but if I change --with-cpu to --with-cpu=cortex-m0  the 
> build would fail with complaint"cannot compute suffix of object files".



More information about the Gcc-help mailing list