Use libatomic if necessary
authorBenjamin Barenblat <bbaren@google.com>
Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)
committerBenjamin Barenblat <bbaren@debian.org>
Mon, 7 Feb 2022 16:54:21 +0000 (16:54 +0000)
Bug-Debian: https://bugs.debian.org/973492

On some architectures, notably armel, Abseil needs symbols defined in
libatomic. Abseil does not currently have a well-developed system to
declare external library dependencies, so just have the linker determine
if anything needs libatomic and add the DT_NEEDED entry where necessary.

Gbp-Pq: Name latomic.diff

absl/copts/AbseilConfigureCopts.cmake

index 942ce90a4d613c6db0f02b54e072f7223c81b87e..231182abb0778331ab0f2e3ffe8b0e2099a6155e 100644 (file)
@@ -62,4 +62,8 @@ else()
   set(ABSL_TEST_COPTS "")
 endif()
 
+list(APPEND ABSL_DEFAULT_LINKOPTS
+    "-Wl,--push-state,--as-needed" "-latomic" "-Wl,--pop-state"
+)
+
 set(ABSL_CXX_STANDARD "${CMAKE_CXX_STANDARD}")