This is the mail archive of the
mailing list for the GCC project.
Problem with libpthread of uClibc
- From: Nitin Garg <nitingarg98 at gmail dot com>
- To: uclibc at uclibc dot org, gcc at gcc dot gnu dot org
- Date: Fri, 29 May 2009 15:53:31 -0500
- Subject: Problem with libpthread of uClibc
We are using ARM Cortex-A9 processor. The toolchain is gcc-4.0.0 with
uClibc-0.9.30 and the kernel is 2.6.28.
Using this toolchain when we build any application like "Hello World"
and link it against pthread lib, the application does a segmentation
fault when executed on target and gives "Illegal instruction" error
I debugged the problem and it came out to be that "swp" instructions
were disabled on the cortex-a9. The SWP instruction has been
deprecated starting with the ARMv6 architecture. On newer ARMv7
processors, this instruction is disabled by default but it can be
enabled by bit 10 in the System Control register. We can also build
the kernel with CONFIG_OABI_COMPAT enabled.
The real problem seems to be in the linuxthreads of uClibc where "swp"
is being used for locks.
Shall this not be replaced with ldrex/strex for ARMv7 onwards?