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]

Newlib for armv6-m (ARM cortex-m0) and wrong assembly in trap.S


Hello,

I've been compiling newlib 2.2.0 for cortex-m0 (arch armv6-m), and I got the following error:

"trap.S:88: Error: lo register required -- `sub ip,sp,ip'"

As an ugly workaround I just commented out that line, and newlib compiled with no further issues.

The "sub ip,sp,ip" is clearly wrong for cortex-m0 - sub op can work on r0Ãr7 only.

trap.S checks for !defined(__thumb2__) , but this arch is thumb.

My GCC was build with --with-cpu=cortex-m0 --with-mode=thumb, and, were it not, I'd probably get garbage machine code from trap.S regardless.

I rested the resulting code on a real mcu, and the libs seem fine.

Would you please consider fixing this file somehow?

Regards,
Jan


Longer context of build messages:

arm-none-eabi-gcc -B/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/build/arm-none-eabi/newlib/ -isystem /tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/build/arm-none-eabi/newlib/targ-include -isystem /tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/newlib-2.2.0
/newlib/libc/include -B/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/build/arm-none-eabi/libgloss/arm -L/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/build/arm-none-eabi/libgloss/libnosys -L/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/newlib-2.2.0/libglos
s/armÂÂÂ -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.2.0\" -DPACKAGE_STRING=\"newlib\ 2.2.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/newlib-2.2.0/newlib/libc/sys/arm -D__SINGLE
_THREAD__ -DARM_RDI_MONITOR -fno-builtinÂÂÂÂ -D__SINGLE_THREAD__ -DARM_RDI_MONITOR -fno-builtinÂÂ -g -O2 -Os -ffunction-sections -fdata-sections -pipe -fomit-frame-pointer -c -o lib_a-trap.o `test -f 'trap.S' || echo '/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/ne
wlib-2.2.0/newlib/libc/sys/arm/'`trap.S
/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/newlib-2.2.0/newlib/libc/sys/arm/trap.S: Assembler messages:
/tmp/portage/cross-arm-none-eabi/newlib-2.2.0/work/newlib-2.2.0/newlib/libc/sys/arm/trap.S:88: Error: lo register required -- `sub ip,sp,ip'
Makefile:268: recipe for target 'lib_a-trap.o' failed


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