summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViolet Purcell <vimproved@inventati.org>2023-02-12 23:51:50 -0500
committerSam James <sam@gentoo.org>2023-02-13 04:59:58 +0000
commitc5750781de5450ed5a3c8e3a37fe6026911623c9 (patch)
tree30da1bea1bab3c8720c6c0c7755fc94372f304cd /dev-libs/libbsd
parentdev-libs/msgpack: enable MSGPACK_CXX17 instead of MSGPACK_CXX11 (diff)
downloadgentoo-c5750781de5450ed5a3c8e3a37fe6026911623c9.tar.gz
gentoo-c5750781de5450ed5a3c8e3a37fe6026911623c9.tar.bz2
gentoo-c5750781de5450ed5a3c8e3a37fe6026911623c9.zip
dev-libs/libbsd: Backport Clang 16 configure fix
Signed-off-by: Violet Purcell <vimproved@inventati.org> Closes: https://github.com/gentoo/gentoo/pull/29566 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/libbsd')
-rw-r--r--dev-libs/libbsd/files/libbsd-build-Fix-version-script-linker-support-detection.patch36
-rw-r--r--dev-libs/libbsd/libbsd-0.11.7-r2.ebuild13
2 files changed, 48 insertions, 1 deletions
diff --git a/dev-libs/libbsd/files/libbsd-build-Fix-version-script-linker-support-detection.patch b/dev-libs/libbsd/files/libbsd-build-Fix-version-script-linker-support-detection.patch
new file mode 100644
index 000000000000..2e45429021ff
--- /dev/null
+++ b/dev-libs/libbsd/files/libbsd-build-Fix-version-script-linker-support-detection.patch
@@ -0,0 +1,36 @@
+From dec783dce5a7131e232a06e63a544645b5463dd8 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@hadrons.org>
+Date: Sun, 12 Feb 2023 23:55:09 +0100
+Subject: [PATCH] build: Fix version script linker support detection
+
+When the linker uses --no-undefined-version either specified by the user
+or as the default behavior (such as with newer clang >= 16 releases),
+a missing symbol definition will cause a linker error if that symbol is
+listed in the version script.
+
+Upstream commit: https://gitlab.freedesktop.org/libbsd/libbsd/-/commit/dec783dce5a7131e232a06e63a544645b5463dd8
+
+---
+ configure.ac | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 17d113c..7d17a93 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,7 +33,11 @@ AC_CACHE_CHECK([if ld supports --version-script flag],
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ AC_LINK_IFELSE([
+- AC_LANG_PROGRAM([], [])
++ AC_LANG_PROGRAM([[
++extern int symbol(void);
++int symbol(void) { return 0; }
++]], [[
++]])
+ ], [
+ libbsd_cv_version_script=yes
+ ], [
+--
+2.39.1.615.ga0422de7ea.dirty
+
diff --git a/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild b/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild
index 0fcfb6bd563b..c70b6bdb49f3 100644
--- a/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild
+++ b/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild
@@ -4,7 +4,7 @@
EAPI=8
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/guillemjover.asc
-inherit multilib multilib-minimal verify-sig
+inherit autotools multilib multilib-minimal verify-sig
DESCRIPTION="Library to provide useful functions commonly found on BSD systems"
HOMEPAGE="https://libbsd.freedesktop.org/wiki/ https://gitlab.freedesktop.org/libbsd/libbsd"
@@ -22,6 +22,17 @@ DEPEND="${RDEPEND}
"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-guillemjover )"
+PATCHES=(
+ "${FILESDIR}/libbsd-build-Fix-version-script-linker-support-detection.patch"
+)
+
+src_prepare() {
+ default
+
+ # Drop on next release, only needed for lld patch
+ eautoreconf
+}
+
multilib_src_configure() {
# The build system will install libbsd-ctor.a despite USE="-static-libs"
# which is correct, see: