public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Paolo Carlini <paolo.carlini@oracle.com>
Cc: Luke Dalessandro <luked@cs.rochester.edu>, gcc@gcc.gnu.org
Subject: Re: Using __sync_* builtins within libgcc code
Date: Tue, 10 Jun 2008 12:01:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0806101155290.19304@digraph.polyomino.org.uk> (raw)
In-Reply-To: <484E21D5.4020201@oracle.com>

On Tue, 10 Jun 2008, Paolo Carlini wrote:

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

I hold that it is a bug that i686-* tools default to -march=i386 instead 
of -march=i686 (whereas e.g. sparcv9-* tools default to -mcpu=sparcv9, and 
-mcpu means -march for SPARC).  My --with-arch-32 etc. patch 
<http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00124.html> (config/i386 
part pending review) would facilitate fixing this bug by making i686-* 
imply --with-arch-32=i686 instead of --with-cpu-32=i686, while leaving the 
64-bit defaults (for which mode -march=i686 is invalid) unaffected.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2008-06-10 12:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10  3:22 Luke Dalessandro
2008-06-10  6:40 ` Paolo Carlini
2008-06-10 12:01   ` Joseph S. Myers [this message]
2008-06-10 14:22     ` Paolo Carlini
2008-06-10 14:39       ` H.J. Lu
2008-06-10 14:43         ` Joseph S. Myers
2008-06-10 15:37           ` H.J. Lu
2008-06-10 15:36         ` Andrew Haley
2008-06-10 16:34       ` Ross Smith
2008-06-11 12:35   ` Luke Dalessandro
2008-06-10 11:45 Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0806101155290.19304@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    --cc=luked@cs.rochester.edu \
    --cc=paolo.carlini@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).