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


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.


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