From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25577 invoked by alias); 29 May 2009 20:53:39 -0000 Received: (qmail 25569 invoked by uid 22791); 29 May 2009 20:53:39 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 May 2009 20:53:33 +0000 Received: by fg-out-1718.google.com with SMTP id 13so2281196fge.5 for ; Fri, 29 May 2009 13:53:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.86.91.13 with SMTP id o13mr3349186fgb.7.1243630411134; Fri, 29 May 2009 13:53:31 -0700 (PDT) Date: Sat, 30 May 2009 16:43:00 -0000 Message-ID: <403c615d0905291353q309876b2ubac57c7ee7e4663e@mail.gmail.com> Subject: Problem with libpthread of uClibc From: Nitin Garg To: uclibc@uclibc.org, gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg00697.txt.bz2 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