llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_

Open llvmbot opened this issue 15 years ago • 7 comments

Bugzilla Link 11174
Resolution FIXED
Resolved on Nov 05, 2015 13:43
Version unspecified
OS All
Blocks llvm/llvm-bugzilla-archive#24345
Reporter LLVM Bugzilla Contributor
CC @Bigcheese,@weiguozhi,@echristo,@efriedma-quic,@rprichard

llvmbot avatar Oct 18 '11 22:10 llvmbot

mentioned in issue llvm/llvm-bugzilla-archive#24345

llvmbot avatar Nov 26 '21 20:11 llvmbot

Fixed in r178816 for x86.

Bigcheese avatar Apr 05 '13 01:04 Bigcheese

Patch: http://llvm-reviews.chandlerc.com/D621

Bigcheese avatar Apr 04 '13 02:04 Bigcheese

I met the same problem when building glib. Since lack of __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, it caused the glib configuration failed.

weiguozhi avatar Jan 10 '13 02:01 weiguozhi

Also see http://llvm.org/bugs/show_bug.cgi?id=12730.

rprichard avatar Jan 06 '13 21:01 rprichard

This is actually an ABI issue, and should be raised in priority. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42734

llvmbot avatar Jan 06 '13 10:01 llvmbot

GCC rather helpfully defines these macros when it is capable of supporting atomic intrinsics for a particular word size. For example:

  • on -march=i386 atomics are not supported
  • on -march=i486 atomics are supported only for word sizes up to 4
  • on -march=i586 and higher it's supported for 8 as well

clang doesn't define these macros and doesn't seem to define anything equivalent either. That prevents having an #ifdef around code that might either use these operations or elect to implement them with a mutex.

llvmbot avatar Oct 18 '11 22:10 llvmbot