From: Sergei Trofimovich Date: Wed, 17 Feb 2021 19:49:06 +0000 (+0000) Subject: StdAtomic.cmake: Probe atomic increment as well (#800) X-Git-Tag: v4.2.1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d16313440cf2a360f3daea9d7cccf7fb0ed17dee;p=thirdparty%2Fccache.git StdAtomic.cmake: Probe atomic increment as well (#800) On sparc there are 8-byte atomic loads and stores available in ISA but not atomic increments. As a result linking fails as: ``` ld: src/libccache_lib.a(InodeCache.cpp.o): undefined reference to symbol '__atomic_fetch_add_8@@LIBATOMIC_1.0' ld: sparc-unknown-linux-gnu/8.2.0/libatomic.so.1: error adding symbols: DSO missing from command line ``` The fix is to add increment into libatomic test. tested on `sparc-unknown-linux-gnu` target. Signed-off-by: Sergei Trofimovich --- diff --git a/cmake/StdAtomic.cmake b/cmake/StdAtomic.cmake index aa3bb4bff..8cebe5157 100644 --- a/cmake/StdAtomic.cmake +++ b/cmake/StdAtomic.cmake @@ -10,6 +10,7 @@ set( int main() { std::atomic x; + ++x; (void)x.load(); return 0; }