Skip to content

Commit

Permalink
StdAtomic.cmake: Probe atomic increment as well (#800)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergei Trofimovich committed Feb 17, 2021
1 parent 6f4fc28 commit d163134
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/StdAtomic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(
int main()
{
std::atomic<long long> x;
++x;
(void)x.load();
return 0;
}
Expand Down

0 comments on commit d163134

Please sign in to comment.