From b5c742b593ffc31bef3d8a6ffdee83f16503b1d5 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 17 Nov 2026 20:53:24 -0500 Subject: [PATCH] app-text/qpdf: delete upstream's broken GNU ld version script This version script is insane, for two reasons: - it marks `global: *` and does nothing else whatsoever, defeating all purpose of a version script - it utilizes the former, to tag all symbols as `LIBQPDF_@qpdf_SOVERSION@`, that is to say it inlines the shared library soname into it Conceptually this is beyond broken. Symbol versioning exists to solve two cases: - There is a genuine and paramount need to load two different shared library versions exporting identical symbols with different ABI into a single process space, and you want to silo off the symbols so they do not conflict each other. - A soname is designed to change when ABI is *broken*, not added to, and version scripts allow fine-grained control over when and how your ABI evolves. - Adding new functions doesn't break ABI, and version scripts can be used to mark the version when a new function was added, to make it easy to detect the minimum version of the library needed. - Modifying functions in a backwards incompatible manner can be done by providing both versions of the function; the new version is aliased to a new symbol version and is used for new compilation, the old version is only available as a binary symbol to satisfy old binaries. Blindly tagging every single function with the soname certainly does not achieve the latter case. The former case is not realistic except in niche scenarios that don't apply here. Problem: marking `*` as versioned cascades into various libstdc++.so symbols marked as undefined in libqpdf.so, e.g. ``` U std::__cxx11::basic_string, std::allocator >::_M_dispose()@LIBQPDF_30 ``` The set of symbols that this applies to is effectively random based on compiler flags / optimizations. Software which links to libqpdf.so gets diverted into the libqpdf versions of these functions for their own use, and error out whenever libqpdf is rebuilt with arbitrarily different CXXFLAGS. Gentoo SLOT= rebuilds are useless. Soname is useless. Remove this ridiculous version script. Bump subslot to force rebuilds. Revbump straight to stable, since this package is *so* broken right now that it is impossible for a straight-to-stable bump which is buggy, to break it even more. Bug: https://github.com/qpdf/qpdf/issues/1808 Closes: https://bugs.gentoo.org/981565 Signed-off-by: Eli Schwartz --- .../qpdf/{qpdf-12.4.1-r1.ebuild => qpdf-12.4.1-r2.ebuild} | 8 ++++++-- .../qpdf/{qpdf-12.4.2.ebuild => qpdf-12.4.2-r1.ebuild} | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) rename app-text/qpdf/{qpdf-12.4.1-r1.ebuild => qpdf-12.4.1-r2.ebuild} (88%) rename app-text/qpdf/{qpdf-12.4.2.ebuild => qpdf-12.4.2-r1.ebuild} (88%) diff --git a/app-text/qpdf/qpdf-12.4.1-r1.ebuild b/app-text/qpdf/qpdf-12.4.1-r2.ebuild similarity index 88% rename from app-text/qpdf/qpdf-12.4.1-r1.ebuild rename to app-text/qpdf/qpdf-12.4.1-r2.ebuild index 53711bba0a805..f456ea2486ad9 100644 --- a/app-text/qpdf/qpdf-12.4.1-r1.ebuild +++ b/app-text/qpdf/qpdf-12.4.1-r2.ebuild @@ -22,8 +22,8 @@ SRC_URI=" LICENSE="|| ( Apache-2.0 Artistic-2 )" # Subslot for libqpdf soname version (just represent via major version) -# XXX: .1 is a fudge for bug #981565, drop w/ >=qpdf-13 -SLOT="0/$(ver_cut 1).1" +# XXX: .2 is a fudge for bug #981565, drop when https://github.com/qpdf/qpdf/issues/1808 is fixed +SLOT="0/$(ver_cut 1).2" KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" IUSE="doc examples gnutls test zopfli" RESTRICT="!test? ( test )" @@ -67,6 +67,10 @@ src_unpack() { src_prepare() { cmake_src_prepare + # bug 981565, changes ABI every time you rebuild + # https://github.com/qpdf/qpdf/issues/1808 + sed -i s'/--version-script/--broken-so-die-horribly-die-die-die/' libqpdf/CMakeLists.txt || die + # broken test rm qpdf/qtest/completion.test || die } diff --git a/app-text/qpdf/qpdf-12.4.2.ebuild b/app-text/qpdf/qpdf-12.4.2-r1.ebuild similarity index 88% rename from app-text/qpdf/qpdf-12.4.2.ebuild rename to app-text/qpdf/qpdf-12.4.2-r1.ebuild index 53711bba0a805..f456ea2486ad9 100644 --- a/app-text/qpdf/qpdf-12.4.2.ebuild +++ b/app-text/qpdf/qpdf-12.4.2-r1.ebuild @@ -22,8 +22,8 @@ SRC_URI=" LICENSE="|| ( Apache-2.0 Artistic-2 )" # Subslot for libqpdf soname version (just represent via major version) -# XXX: .1 is a fudge for bug #981565, drop w/ >=qpdf-13 -SLOT="0/$(ver_cut 1).1" +# XXX: .2 is a fudge for bug #981565, drop when https://github.com/qpdf/qpdf/issues/1808 is fixed +SLOT="0/$(ver_cut 1).2" KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" IUSE="doc examples gnutls test zopfli" RESTRICT="!test? ( test )" @@ -67,6 +67,10 @@ src_unpack() { src_prepare() { cmake_src_prepare + # bug 981565, changes ABI every time you rebuild + # https://github.com/qpdf/qpdf/issues/1808 + sed -i s'/--version-script/--broken-so-die-horribly-die-die-die/' libqpdf/CMakeLists.txt || die + # broken test rm qpdf/qtest/completion.test || die }