From c05efa34a3783cac642344b44e6ec8d70fe3dcba Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Fri, 6 Dec 2024 11:45:01 -0500 Subject: [PATCH] OpenBSD `--strip-unneeded` strips too much Brought to our attention by maerwald; see https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/lang/ghc/patches/patch-libraries_Cabal_Cabal_Distribution_Simple_Program_Strip_hs. (cherry picked from commit cd4bd1f6e8701e12e157898354fa4e33535a4001) --- Cabal/src/Distribution/Simple/Program/Strip.hs | 4 ++++ changelog.d/pr-10616 | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 changelog.d/pr-10616 diff --git a/Cabal/src/Distribution/Simple/Program/Strip.hs b/Cabal/src/Distribution/Simple/Program/Strip.hs index bb43e5ed47d..af7bbfc9754 100644 --- a/Cabal/src/Distribution/Simple/Program/Strip.hs +++ b/Cabal/src/Distribution/Simple/Program/Strip.hs @@ -58,6 +58,10 @@ stripLib verbosity (Platform arch os) progdb path = do IOS -> return () AIX -> return () Solaris -> return () + OpenBSD -> + -- '--strip-unneeded' sometimes strips too much on OpenBSD. + -- -- See https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/lang/ghc/patches/patch-libraries_Cabal_Cabal_Distribution_Simple_Program_Strip_hs + return () Windows -> -- Stripping triggers a bug in 'strip.exe' for -- libraries with lots identically named modules. See diff --git a/changelog.d/pr-10616 b/changelog.d/pr-10616 new file mode 100644 index 00000000000..89d6bc1d985 --- /dev/null +++ b/changelog.d/pr-10616 @@ -0,0 +1,11 @@ +--- +synopsis: "OpenBSD `--strip-unneeded` sometimes strips too much" +packages: [Cabal] +prs: 10616 +--- + +OpenBSD's `--strip-unneeded` thinks some symbols are unneeded that are in fact +needed when C bits are involved, so suppress its use. + +Taken from the OpenBSD ports repo (https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/lang/ghc/patches/patch-libraries_Cabal_Cabal_Distribution_Simple_Program_Strip_hs); +brought to our attention by maerwald.