From 8081530e824c092d36b1ef7947783c5859eb8b61 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 6 Nov 2020 10:58:29 -0500 Subject: Link libatomic when appropriate Closes: https://bugs.debian.org/973492 --- debian/changelog | 2 ++ debian/patches/latomic.diff | 20 ++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 23 insertions(+) create mode 100644 debian/patches/latomic.diff diff --git a/debian/changelog b/debian/changelog index d2a7b450..8ee580ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ abseil (0~20200923.2-1) UNRELEASED; urgency=medium * New upstream release. * Fix build on hppa via patch. (Closes: #971768) + * Link libatomic where necessary to prevent issues with load-time + symbol resolution. (Closes: #973492) -- Benjamin Barenblat Fri, 06 Nov 2020 10:39:11 -0500 diff --git a/debian/patches/latomic.diff b/debian/patches/latomic.diff new file mode 100644 index 00000000..d78c7469 --- /dev/null +++ b/debian/patches/latomic.diff @@ -0,0 +1,20 @@ +From: Benjamin Barenblat +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 +@@ -64,4 +64,8 @@ + set(ABSL_TEST_COPTS "") + endif() + ++list(APPEND ABSL_DEFAULT_LINKOPTS ++ "-Wl,--as-needed" "-latomic" "-Wl,--no-as-needed" ++) ++ + set(ABSL_CXX_STANDARD "${CMAKE_CXX_STANDARD}") diff --git a/debian/patches/series b/debian/patches/series index 481e6995..95a122f0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ configure.diff fix-hppa.diff +latomic.diff -- cgit v1.2.3