From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32519 invoked by alias); 10 Jun 2008 11:45:40 -0000 Received: (qmail 32511 invoked by uid 22791); 10 Jun 2008 11:45:40 -0000 X-Spam-Check-By: sourceware.org Received: from fk-out-0910.google.com (HELO fk-out-0910.google.com) (209.85.128.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jun 2008 11:45:17 +0000 Received: by fk-out-0910.google.com with SMTP id 19so1381431fkr.8 for ; Tue, 10 Jun 2008 04:45:14 -0700 (PDT) Received: by 10.82.118.2 with SMTP id q2mr326387buc.80.1213098314560; Tue, 10 Jun 2008 04:45:14 -0700 (PDT) Received: by 10.82.161.2 with HTTP; Tue, 10 Jun 2008 04:45:14 -0700 (PDT) Message-ID: <5787cf470806100445h9c081d9m3722d428f8a89203@mail.gmail.com> Date: Tue, 10 Jun 2008 11:45:00 -0000 From: "Uros Bizjak" To: "Luke Dalessandro" Subject: Re: Using __sync_* builtins within libgcc code Cc: GCC MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/msg00222.txt.bz2 Hello! > 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. You have to compile library with -march=i486 to activate these instructions. Alternatively, you can use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1, 2, 4, 8, 16} to fall back to generic implementation. Uros.