Can't build libpthread for M3

Andrii bearrailgun at gmail.com
Thu Oct 9 20:29:01 UTC 2014


I'm trying to build uClibc for Cortex-M3 LPC17XX with codesourcery g++ lite
arm2010q1(189) toolchain.
I've tried 0.9.30.3, 0.9.33.2 and latest git a9bdc5d2 with almost same
results.
Here is the output from latest git:

When trying to build with old linuxthreads:
  CC libpthread/linuxthreads.old/mutex.os
/tmp/ccB7JHC6.s: Assembler messages:
/tmp/ccB7JHC6.s:29: Error: selected processor does not support ARM opcodes
/tmp/ccB7JHC6.s:30: Error: attempt to use an ARM instruction on a
Thumb-only processor -- `swp r3,r3,[r0]'
/tmp/ccB7JHC6.s:31: Error: attempt to use an ARM instruction on a
Thumb-only processor -- `orr r0,pc,#1'
/tmp/ccB7JHC6.s:32: Error: attempt to use an ARM instruction on a
Thumb-only processor -- `bx r0'
/tmp/ccB7JHC6.s:58: Error: selected processor does not support ARM opcodes
/tmp/ccB7JHC6.s:59: Error: attempt to use an ARM instruction on a
Thumb-only processor -- `swp r2,r2,[r0]'
/tmp/ccB7JHC6.s:60: Error: attempt to use an ARM instruction on a
Thumb-only processor -- `orr r0,pc,#1'
/tmp/ccB7JHC6.s:61: Error: attempt to use an ARM instruction on a
Thumb-only processor -- `bx r0'
make: *** [libpthread/linuxthreads.old/mutex.os] Error 1

New linux threads:
  CC libpthread/linuxthreads/sysdeps/arm/pspinlock.os
In file included from ./libpthread/linuxthreads/descr.h:46,
                 from ./libpthread/linuxthreads/internals.h:36,
                 from libpthread/linuxthreads/sysdeps/arm/pspinlock.c:21:
./libpthread/linuxthreads/sysdeps/arm/pt-machine.h:36: warning: no previous
prototype for 'testandset'
/tmp/cczGDaGC.s: Assembler messages:
/tmp/cczGDaGC.s:27: Error: selected processor does not support Thumb mode
`swp r3,r3,[r0]'
/tmp/cczGDaGC.s:46: Error: selected processor does not support Thumb mode
`swp r3,r3,[r0]'
make: *** [libpthread/linuxthreads/sysdeps/arm/pspinlock.os] Error 1

NPTL:
-----
  CC libpthread/nptl/pthread_atfork.os
  AS libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.os
libpthread/nptl/sysdeps/unix/sysv/linux/arm/../../../../../../../libc/sysdeps/linux/arm/vfork.S:
Assembler messages:
libpthread/nptl/sysdeps/unix/sysv/linux/arm/../../../../../../../libc/sysdeps/linux/arm/vfork.S:72:
Error: only SUBS PC, LR, #const allowed -- `sub pc,r0,#31'
libpthread/nptl/sysdeps/unix/sysv/linux/arm/../../../../../../../libc/sysdeps/linux/arm/vfork.S:74:
Error: thumb conditional instruction should be in IT block -- `strne
r3,[r2,#-1044]'
make: *** [libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.os] Error 1

Extra CFLAGS :
march=armv7-m -mthumb -Wl, -elf2flt -Wa, -march=armv7-m -Wa, -mthumb

As I undestand thumb2 doesn't support swp instruction. But is there a way
to avoid hardcoded swp instructions in threads code (spinlock
implementation)?

Regards.


More information about the uClibc mailing list