This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using __sync_* builtins within libgcc code
- From: Luke Dalessandro <luked at cs dot rochester dot edu>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 11 Jun 2008 08:34:42 -0400
- Subject: Re: Using __sync_* builtins within libgcc code
- References: <484DF34C.5040005@cs.rochester.edu> <484E21D5.4020201@oracle.com>
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'
Maybe you can usefully exploit the recently added
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros or add a few more along the
same way...
Thank you Paolo, this allows me to wrap cas in a function that falls back to a
mutex for targets that don't support builtins.
I was aware of the i386 restriction, but didn't realize that i686-* platforms
still defaulted to i386.
Thanks for everyone's help.
Luke