From: Alistair Francis Date: Tue, 11 Aug 2020 17:13:37 +0000 (-0700) Subject: CMake: Link with -latomic X-Git-Tag: 10.91.0^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=9a8aea1b682f522d7b278312b9bd85ed12fab820 CMake: Link with -latomic 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 Change-Id: Iad543232a6547b197f04100e996e6200c9f803ce --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 62c56a9c..0a2713ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,6 +155,7 @@ SET(link_libraries ${LIBMAGIC_LDFLAGS} -ldl -lrt + -latomic ) ADD_SUBDIRECTORY(src/devtools) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3e3a9e15..ab776626 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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