There is no __sync_synchronize or __sync_val_compare_and_swap on Mac OS X. One might use OSMemoryBarrier or OSAtomicCompareAndSwap32 instead. The patch is attached. - xi -------------- next part -------------- A non-text attachment was scrubbed... Name: patch Type: application/octet-stream Size: 1248 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090524/6f854791/attachment.obj>
On May 23, 2009, at 9:41 PM, Xi Wang wrote:> There is no __sync_synchronize or __sync_val_compare_and_swap on Mac > OS X. One might use OSMemoryBarrier or OSAtomicCompareAndSwap32 > instead. The patch is attached.Actually, __sync_synchronize and __sync_val_compare_and_swap DO exist on Darwin, but only if you use Apple's GCC 4.2 (or later), just as it is on Linux. We always want to use these intrinsic versions if possible, because they're much lower overhead. The policy Chris has proposed is that we simply do not support multithreaded LLVM with a host compiler pre-GCC 4.2. If you need multithreaded LLVM on an unsupported platform, you can build a single threaded LLVM and LLVM-GCC, and then use that to build a multithreaded LLVM. --Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090523/72cf4cc3/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2620 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090523/72cf4cc3/attachment.bin>
Thanks. I think I am using Apple GCC 4.2. i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5566) Should I use something else for LLVM? - xi On Sun, May 24, 2009 at 1:20 AM, Owen Anderson <resistor at mac.com> wrote:> > On May 23, 2009, at 9:41 PM, Xi Wang wrote: > > There is no __sync_synchronize or __sync_val_compare_and_swap on Mac > OS X. One might use OSMemoryBarrier or OSAtomicCompareAndSwap32 > instead. The patch is attached. > > Actually, __sync_synchronize and __sync_val_compare_and_swap DO exist on > Darwin, but only if you use Apple's GCC 4.2 (or later), just as it is on > Linux. We always want to use these intrinsic versions if possible, because > they're much lower overhead. > The policy Chris has proposed is that we simply do not support multithreaded > LLVM with a host compiler pre-GCC 4.2. If you need multithreaded LLVM on an > unsupported platform, you can build a single threaded LLVM and LLVM-GCC, and > then use that to build a multithreaded LLVM. > --Owen > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >