Remove -latomic if unnecessary

Matt Glazar strager at
Tue Feb 3 17:34:06 PST 2015

My Linux toolchain supports __atomic_fetch_add_4 without -latomic.
Specifying -latomic fails because libatomic.{so,a} does not exist.

In CMake, first check if __atomic_fetch_add_4 can be used without
-latomic.  If it can't, try with -latomic.

See attached patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: latomic.patch
Type: application/octet-stream
Size: 741 bytes
Desc: latomic.patch
URL: <>

More information about the llvm-commits mailing list