OSDN Git Service

configure.ac/meson.build: Fix -latomic test
authorNicolas Boichat <drinkcat@chromium.org>
Thu, 5 Apr 2018 01:33:09 +0000 (09:33 +0800)
committerMatt Turner <mattst88@gmail.com>
Mon, 7 May 2018 17:14:53 +0000 (10:14 -0700)
commit54ba73ef102f7b9085922686bb31719539e0dc3c
tree51044bfaf20d574880c3ff833f9c89dc8f3aa7d9
parent8b519075eac86a4b2187020f1f54c5e5b979b40d
configure.ac/meson.build: Fix -latomic test

When compiling with LLVM 6.0 on x86 (32-bit) for Android, the test
fails to detect that -latomic is actually required, as the atomic
call is inlined.

In the code itself (src/util/disk_cache.c), we see this pattern:
p_atomic_add(cache->size, - (uint64_t)size);
where cache->size is an uint64_t *, and results in the following
link time error without -latomic:
src/util/disk_cache.c:628: error: undefined reference to '__atomic_fetch_add_8'

Fix the configure/meson test to replicate this pattern, which then
correctly realizes the need for -latomic.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
configure.ac
meson.build