From: Alberto Garcia Date: Fri, 6 Mar 2015 07:33:11 +0000 (+0000) Subject: Some architectures need to add -latomic explicitly X-Git-Tag: archive/raspbian/2.14.3-1+rpi1~1^2^2^2~27 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fd77b410fef2847f5b4d998d4475cea3e3e1c303;p=webkit2gtk.git Some architectures need to add -latomic explicitly =================================================================== Gbp-Pq: Name atomic_build_fix.patch --- diff --git a/Source/cmake/OptionsCommon.cmake b/Source/cmake/OptionsCommon.cmake index ffcdfe5296..5c8ecb93fb 100644 --- a/Source/cmake/OptionsCommon.cmake +++ b/Source/cmake/OptionsCommon.cmake @@ -69,3 +69,10 @@ endif () # files must be used to deal with very long linker command lines. # See https://bugs.webkit.org/show_bug.cgi?id=129771 set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1) + +try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/atomic.cpp) +if (NOT ATOMIC_BUILD_SUCCEEDED) + message(STATUS "Adding -latomic to the linker flags") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--push-state,--no-as-needed,-latomic,--pop-state") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--push-state,--no-as-needed,-latomic,--pop-state") +endif() diff --git a/atomic.cpp b/atomic.cpp new file mode 100644 index 0000000000..4ddf3ac7af --- /dev/null +++ b/atomic.cpp @@ -0,0 +1,7 @@ +#include + +int main() { + std::atomic i(0); + i++; + return 0; +}