This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: arm-elf thumb-2 issue in newlib or gas?



info.gnu@rt-labs.com wrote:
>> Hello 
>>
>> I configure arm-elf with thumb-2 support but ran into problem when I came
>to
>> Newlib
>>
>>   $ ../newlib-1.16.0/configure --target=arm-elf
>> --prefix=/proj/crossgcc/arm-elf --disable-nls
>> --disable-newlib-supplied-syscalls --disable-newlib-mb
>> --disable-newlib-io-pos-args --disable-newlib-io-long-long
>> --disable-newlib-io-long-double --disable-newlib-iconv
>> --enable-newlib-multithread
>>  
>>
>> arm-elf-gcc
>> -B/proj/buildcross/build/build_newlib/arm-elf/thumb/thumb2/newlib/
->isystem
>>
/proj/buildcross/build/build_newlib/arm-elf/thumb/thumb2/newlib/targ->includ
e
>> -isystem /proj/buildcross/build/newlib-1.16.0/newlib/libc/include
>> -B/proj/buildcross/build/build_newlib/arm-elf/thumb/thumb2/libgloss/arm
>>
-L/proj/buildcross/build/build_newlib/arm->elf/thumb/thumb2/libgloss/libnosy
s
>> -L/proj/buildcross/build/newlib-1.16.0/libgloss/arm  -mthumb -march=armv7
>> -O2 -D__NO_SYSCALLS__ -fno-builtin   -mthumb -march=armv7 -c -o
>> lib_a-setjmp.o `test -f 'setjmp.S' || echo
>> '../../../../../../../../newlib-1.16.0/newlib/libc/machine/arm/'`setjmp.S
>> ../../../../../../../../newlib-1.16.0/newlib/libc/machine/arm/setjmp.S:
>> Assembler messages:
>>
../../../../../../../../newlib->1.16.0/newlib/libc/machine/arm/setjmp.S:123:
>> Error: SP not allowed in register list -- `stmea a1!,{v1-v7,fp,ip,sp,lr}'
>>
../../../../../../../../newlib->1.16.0/newlib/libc/machine/arm/setjmp.S:145:
>> Error: SP not allowed in register list -- `ldmfd a1!,{v1-v7,fp,ip,sp,lr}'
>> make[9]: *** [lib_a-setjmp.o] Error 1
>> make[9]: Leaving directory
>> `/proj/buildcross/build/build_newlib/arm
>elf/thumb/thumb2/newlib/libc/machin
>> e/arm'
>>  
>>
>> What is the correct solution, what I can see it is an issue in either
>> setjmp.S using SP or the gas function triggering error for SP,  or im a
>> missing something else? 
>>
>> 

>Nope, that seems to be about right. I would suggest you post to the gcc 
>list to see if the error is correct for the given compiler arguments. 
>There are __thumb__ and __thumb2__ flagged sections already in setjmp.S 
>and the particular insns above are not singled out.


OK, cause I first read this report in
http://gcc.gnu.org/ml/gcc-bugs/2008-04/msg00996.html and they place the
problem in binutils or newlib. 

And when you look in gas\config\tc-arm.c it is special thumb-2 function
generating the error

/* Helper function used for both push/pop and ldm/stm.  */
static void
encode_thumb2_ldmstm (int base, unsigned mask, bfd_boolean writeback)

...

  if (mask & (1 << 13))
    inst.error =  _("SP not allowed in register list");

and if we're running 32-bit thumb-2 instruction that is true, SP can't be in
the list. 

regards andreas
www.rt-kernel.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]