building for Cortex M3

Allen Curtis
Tue Oct 20 01:17:00 GMT 2009

> Allen,
> All,
> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>> I would like to build a toolchain for the Cortex M3. The sample
>>> configurations include a Cortex A8. Is it as simple as changing  
>>> the A8
>>> references in .config to M3?
> [--SNIP--]
>> If all goes well, you should set the following:
>> CT_ARCH_ARCH: armv7-m     (I'm not so sure about that one, if it  
>> fails,
>>                           leave the field empty)
>> CT_ARCH_CPU : cortex-m3
>> CT_ARCH_TUNE: cortex-m3

I removed CT_ARCH_ARCH="armv7-m" and left the CPU and TUNE options.  
This fixed the previous compile problem.

Here is the latest error:

[ALL  ]    /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/ 
version.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite- 
strings -fmerge-all-constants -mcpu=cortex-m3 -mlittle-endian -msoft- 
float -mtune=cortex-m3 -Wstrict-prototypes      -I../include -I/home/ 
startfiles/csu -I/home/acurtis/work/targets/arm-cortex_m3-linux- 
gnueabi/build/build-libc-startfiles -I../ports/sysdeps/arm/elf -I../ 
ports/sysdeps/unix/sysv/linux/arm/eabi/nptl -I../ports/sysdeps/unix/ 
sysv/linux/arm/eabi -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ 
ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux - 
I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/ 
sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/ 
unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/ 
sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv - 
I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/ 
unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/eabi - 
I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/ 
wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 - 
I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../ 
nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /home/acurtis/ 
arm-cortex_m3-linux-gnueabi/4.4.0/include -isystem /home/acurtis/work/ 
cortex_m3-linux-gnueabi/4.4.0/include-fixed -isystem /home/acurtis/x- 
root/usr/include -D_LIBC_REENTRANT -include ../include/libc- 
symbols.h        -DHAVE_INITFINI -o /home/acurtis/work/targets/arm- 
cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o -MD - 
MP -MF /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/ 
build-libc-startfiles/csu/version.o.dt -MT /home/acurtis/work/targets/ 
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S: Assembler messages:
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S:51: Error: lo register  
required -- `sub pc,r0,#31'
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S:54: Error: invalid base  
register for register offset -- `ldr r2,[pc,r2]'
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S:56: Error: unshifted  
register required -- `mvn r0,#0'
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3- 
linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    /tmp/ccz4hkoK.s: Assembler messages:
[ALL  ]    /tmp/ccz4hkoK.s:152: Error: only SUBS PC, LR, #const  
allowed -- `add pc,r3,#(0xffff0fc0-0xffff0fff)'
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3- 
linux-gnueabi/build/build-libc-startfiles/csu/libc-start.o] Error 1
[ALL  ]    make[3]: Leaving directory `/home/acurtis/work/targets/src/ 
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[2]: Leaving directory `/home/acurtis/work/targets/src/ 
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[1]: Leaving directory `/home/acurtis/work/targets/arm- 
[ERROR]    Build failed in step 'Installing C library start files'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.5.0/ 
scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/ 
scripts/build/libc/' at line # 341 in function  
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/ 
scripts/' at line # 544 in function 'main'
[ERROR]    Look at '/home/acurtis/x-tools/arm-cortex_m3-linux-gnueabi/ 
build.log' for more info on this error.
[ERROR]  (elapsed: 8:30.46)

I did some Googling and couldn't find anything that addressed this  
issue. If you do, let me know how to be more effective with the  


For unsubscribe information see

More information about the crossgcc mailing list