]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
StdAtomic.cmake: Probe atomic increment as well (#800)
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 17 Feb 2021 19:49:06 +0000 (19:49 +0000)
committerGitHub <noreply@github.com>
Wed, 17 Feb 2021 19:49:06 +0000 (20:49 +0100)
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 <slyfox@gentoo.org>
cmake/StdAtomic.cmake

index aa3bb4bff02c0c37d3f387c7110c45ecb38978e3..8cebe515709f3ac00eb8430bd36db12c07a4052a 100644 (file)
@@ -10,6 +10,7 @@ set(
     int main()
     {
       std::atomic<long long> x;
+      ++x;
       (void)x.load();
       return 0;
     }