public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with libpthread of uClibc
@ 2009-05-30 16:43 Nitin Garg
  2009-05-30 17:58 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Nitin Garg @ 2009-05-30 16:43 UTC (permalink / raw)
  To: uclibc, gcc

Hi,

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
message.

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?

Regards,
Nitin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem with libpthread of uClibc
  2009-05-30 16:43 Problem with libpthread of uClibc Nitin Garg
@ 2009-05-30 17:58 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2009-05-30 17:58 UTC (permalink / raw)
  To: Nitin Garg; +Cc: gcc

Nitin Garg <nitingarg98@gmail.com> writes:

> 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
> message.
>
> 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?

This message is not appropriate for the mailing list gcc@gcc.gnu.org.
gcc@gcc.gnu.org is for the discussion of gcc development.  Please take
any followups to this message to gcc-help@gcc.gnu.org.  Thanks.

Actually I'm not sure there is any gcc issue here at all.  gcc 4.0.0 is
fairly old.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-30  0:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-30 16:43 Problem with libpthread of uClibc Nitin Garg
2009-05-30 17:58 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).