Quantcast
Viewing all articles
Browse latest Browse all 22085

How can I link __sync_bool_compare_and_swap_16?

I've got some code that uses the gcc builtin __sync_bool_compare_and_swap, which is mapped to __sync_bool_compare_and_swap_16 at linktime. But when I link this code I get a "undefined reference to `__sync_bool_compare_and_swap_16'" linker-error. What do I have to link ?

[EDIT]: I got it: I've to compile it with -march:x86-64. Interestingly this doesn't lead to intrinsic compilation, i.e. the compiler inserts the atomic operations appropriately; no, the code is just the same with the call to __sync_bool_compare_and_swap_16, but without a linker error. Does anynone understand this ?


Viewing all articles
Browse latest Browse all 22085

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>