CMake: Link with -latomic 98/25098/2 10.91.0 10.92.0 10.93.0 11.91.0 11.92.0 12.90.0 koi/10.91.0 koi/10.92.0 koi/10.93.0 koi_10.91.0 koi_10.92.0 koi_10.93.0 lamprey/11.91.0 lamprey/11.92.0 lamprey_11.91.0 lamprey_11.92.0 marlin/12.90.0 marlin_12.90.0
authorAlistair Francis <alistair.francis@wdc.com>
Tue, 11 Aug 2020 17:13:37 +0000 (10:13 -0700)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 30 Sep 2020 11:50:40 +0000 (11:50 +0000)
Some architecutres (such as RISC-V) require that atomics be specifically
linked to avoid build failures. Ensure that this is the case.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Change-Id: Iad543232a6547b197f04100e996e6200c9f803ce

CMakeLists.txt
src/CMakeLists.txt

index 62c56a9..0a2713a 100644 (file)
@@ -155,6 +155,7 @@ SET(link_libraries
        ${LIBMAGIC_LDFLAGS}
        -ldl
        -lrt
+       -latomic
        )
 
 ADD_SUBDIRECTORY(src/devtools)
index 3e3a9e1..ab77662 100644 (file)
@@ -172,6 +172,7 @@ TARGET_LINK_LIBRARIES(afbwsc
        ${libsystemd_LDFLAGS}
        ${json-c_LDFLAGS}
        -lpthread
+       -latomic
        -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-afbwsc.map
        -Wl,--as-needed
        -Wl,--gc-sections