This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using __sync_* builtins within libgcc code


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]