building for Cortex M3

Allen Curtis ajcurtis@ac2enterprises.com
Tue Oct 20 16:47:00 GMT 2009


Hello Yann,

>
> 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
>
> OK, I just tested, it does not work. Error message is:
> cc1: error: target CPU does not support ARM mode
>
> Both gcc and glibc complain, although the gcc build does not stop, and
> happily goes on, even if the newly-built gcc is broken. Then glibc  
> breaks
> becasue the compiler does not support ARM mode...
>

Well, I took a shot on the glibc build problem and added -mthumb to  
the CFLAGS. It got past that problem and on to another in the same file.

[ALL  ]    /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/ 
build/gcc-core-static/bin/arm-cortex_m3-linux-gnueabi-gcc      
version.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite- 
strings -fmerge-all-constants -mcpu=cortex-m3 -mlittle-endian -msoft- 
float -mthumb -mtune=cortex-m3 -Wstrict-prototypes      -I../include - 
I/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build- 
libc-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/ 
work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/ 
arm-cortex_m3-linux-gnueabi/4.4.0/include -isystem /home/acurtis/work/ 
targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/arm- 
cortex_m3-linux-gnueabi/4.4.0/include-fixed -isystem /home/acurtis/x- 
tools/arm-cortex_m3-linux-gnueabi/arm-cortex_m3-linux-gnueabi//sys- 
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/ 
arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o
[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/ccXKHoQe.s: Assembler messages:
[ALL  ]    /tmp/ccXKHoQe.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/ 
glibc-cvs-2.9/csu'
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[2]: Leaving directory `/home/acurtis/work/targets/src/ 
glibc-cvs-2.9'
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[1]: Leaving directory `/home/acurtis/work/targets/arm- 
cortex_m3-linux-gnueabi/build/build-libc-startfiles'
[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/glibc.sh' at line # 341 in function  
'do_libc_start_files'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/ 
scripts/crosstool-NG.sh' at line # 544 in function 'main'

Any Ideas???

- Allen

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list