From 8bd0ae5f71bfbbe3509f644cba58157810b65269 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Mon, 31 Jan 2022 16:58:42 -0500 Subject: Stop forcing -Wl,--as-needed on dependents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 8081530e824c092d36b1ef7947783c5859eb8b61 added -Wl,--as-needed -latomic -Wl,--no-as-needed to ensure libatomic got linked on platforms that needed it (see https://bugs.debian.org/973492). However, this inadventantly added -Wl,--no-as-needed to dependents’ link lines when they built with CMake. Switch to -Wl,--push-state,--as-needed -latomic -Wl,--pop-state instead to ensure dependents’ link settings remain intact. As an added bonus, this removes -Wl,--as-needed from the Abseil build itself, allowing a bunch of libraries that don’t actually need libc to omit a libc dependency. Closes: https://bugs.debian.org/1001596 --- debian/patches/latomic.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian/patches') diff --git a/debian/patches/latomic.diff b/debian/patches/latomic.diff index 404144e2..861f20bf 100644 --- a/debian/patches/latomic.diff +++ b/debian/patches/latomic.diff @@ -14,7 +14,7 @@ if anything needs libatomic and add the DT_NEEDED entry where necessary. endif() +list(APPEND ABSL_DEFAULT_LINKOPTS -+ "-Wl,--as-needed" "-latomic" "-Wl,--no-as-needed" ++ "-Wl,--push-state,--as-needed" "-latomic" "-Wl,--pop-state" +) + set(ABSL_CXX_STANDARD "${CMAKE_CXX_STANDARD}") -- cgit v1.2.3