File: latomic.diff

package info (click to toggle)
abseil 20240722.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,084 kB
  • sloc: cpp: 169,405; ansic: 1,738; pascal: 1,513; sh: 774; python: 476; makefile: 31
file content (20 lines) | stat: -rw-r--r-- 710 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
From: Benjamin Barenblat <bbaren@google.com>
Subject: Use libatomic if necessary
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.

--- a/absl/copts/AbseilConfigureCopts.cmake
+++ b/absl/copts/AbseilConfigureCopts.cmake
@@ -103,4 +103,8 @@
   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}")