From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17510 invoked by alias); 10 Jun 2008 06:40:54 -0000 Received: (qmail 17498 invoked by uid 22791); 10 Jun 2008 06:40:53 -0000 X-Spam-Check-By: sourceware.org Received: from agminet01.oracle.com (HELO agminet01.oracle.com) (141.146.126.228) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jun 2008 06:40:34 +0000 Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m5A6eTSl021126; Tue, 10 Jun 2008 01:40:30 -0500 Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m5A1dYeS027168; Tue, 10 Jun 2008 00:40:27 -0600 Received: from vis097b.inria.fr by acsmt359.oracle.com with ESMTP id 10140007041213080023; Tue, 10 Jun 2008 01:40:23 -0500 Message-ID: <484E21D5.4020201@oracle.com> Date: Tue, 10 Jun 2008 06:40:00 -0000 From: Paolo Carlini User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Luke Dalessandro CC: gcc@gcc.gnu.org Subject: Re: Using __sync_* builtins within libgcc code References: <484DF34C.5040005@cs.rochester.edu> In-Reply-To: <484DF34C.5040005@cs.rochester.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: 2008-06/txt/msg00214.txt.bz2 Luke Dalessandro wrote: > I'm making some modifications to exception handling inside of > unwind-dw2-fde.c that I'd like to use __sync_bool_compare_and_swap > for, unfortunately I can't seem to figure out how to correctly use > builtins in the context of libgcc. > > I've tried a bunch of different things, but I consistently get the error > > bin/../lib/gcc/i686-pc-linux-gnu/4.3.1/../../../libgcc_s.so: > undefined reference to `__sync_bool_compare_and_swap_4' > > so clearly I'm not getting this symbol included correctly when I > build. Any advice would be appreciated. Isn't this the well know, annoying, issue that the default sub-architecture is i386 and the builtins are only available on i486 and later? Maybe you can usefully exploit the recently added __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros or add a few more along the same way... Paolo.