summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbea <orbea@riseup.net>2022-07-16 21:14:25 -0700
committerSam James <sam@gentoo.org>2022-07-25 05:09:53 +0100
commitcedc01467acc01d153eb30d26e9ed476fb6ca24f (patch)
tree8bfcd97f14e5d698d9da0fb3deac8c8aa576930d /dev-libs/libtpms
parentnet-libs/libtorrent-rasterbar: add 2.0.7 (diff)
downloadgentoo-cedc01467acc01d153eb30d26e9ed476fb6ca24f.tar.gz
gentoo-cedc01467acc01d153eb30d26e9ed476fb6ca24f.tar.bz2
gentoo-cedc01467acc01d153eb30d26e9ed476fb6ca24f.zip
dev-libs/libtpms: Fix FEATURES=test with slibtool
Bug: https://bugs.gentoo.org/858671 Upstream-PR: https://github.com/stefanberger/libtpms/pull/344 Upstream-Commit: https://github.com/stefanberger/libtpms/commit/0c2bc32a21e2c7218faa8cd6d5cf31b13835e6d5 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/libtpms')
-rw-r--r--dev-libs/libtpms/files/libtpms-0.9.5-slibtool.patch52
-rw-r--r--dev-libs/libtpms/libtpms-0.9.5.ebuild1
2 files changed, 53 insertions, 0 deletions
diff --git a/dev-libs/libtpms/files/libtpms-0.9.5-slibtool.patch b/dev-libs/libtpms/files/libtpms-0.9.5-slibtool.patch
new file mode 100644
index 000000000000..7e83434db151
--- /dev/null
+++ b/dev-libs/libtpms/files/libtpms-0.9.5-slibtool.patch
@@ -0,0 +1,52 @@
+Bug: https://bugs.gentoo.org/858671
+Upstream-PR: https://github.com/stefanberger/libtpms/pull/344
+Upstream-Commit: https://github.com/stefanberger/libtpms/commit/0c2bc32a21e2c7218faa8cd6d5cf31b13835e6d5
+
+From 343f1b21b36fe98daf31c355ebc12902ba7e162a Mon Sep 17 00:00:00 2001
+From: orbea <orbea@riseup.net>
+Date: Fri, 15 Jul 2022 17:02:43 -0700
+Subject: [PATCH] tests: Fix the build with slibtool
+
+When building the tests with `make check` and slibtool the tests will
+then all fail to load libtpms.so.0.
+
+ $ ./base64decode
+ /tmp/libtpms/tests/.libs/base64decode: error while loading shared libraries: libtpms.so.0: cannot open shared object file: No such file or directory
+
+This happens because they are linked with -ltpms rather than the
+libtpms.la file which has unexpected results with slibtool. GNU libtool
+does some magic to make this work while slibtool fails to link the
+dependency.
+
+The correct way to link internal dependencies is directly with the
+libtool archive (.la) files where the -lfoo linker flags should be only
+used with external dependencies. Additionally -no-undefined is added to
+the LDFLAGS to ensure there aren't undefined references in the future.
+
+Note:
+
+* This doesn't happen if libtpms is installed to the system and the tests
+ find the already installs libtpms rather than the newly built library.
+
+* GNU libtool silently ignores -no-undefined, but slibtool will respect
+ it.
+
+Signed-off-by: orbea <orbea@riseup.net>
+---
+ tests/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index eb23c59a4..d3d831938 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -10,7 +10,8 @@ TESTS_ENVIRONMENT = \
+ abs_top_srcdir=`cd '$(top_srcdir)'; pwd`
+
+ AM_CFLAGS = -I$(top_srcdir)/include $(SANITIZERS)
+-AM_LDFLAGS = -ltpms -L$(top_builddir)/src/.libs $(SANITIZERS)
++AM_LDFLAGS = -no-undefined $(SANITIZERS)
++LDADD = $(top_builddir)/src/libtpms.la
+
+ check_PROGRAMS = \
+ base64decode
diff --git a/dev-libs/libtpms/libtpms-0.9.5.ebuild b/dev-libs/libtpms/libtpms-0.9.5.ebuild
index fc15af9bf0f4..4db20b1b4c77 100644
--- a/dev-libs/libtpms/libtpms-0.9.5.ebuild
+++ b/dev-libs/libtpms/libtpms-0.9.5.ebuild
@@ -18,6 +18,7 @@ BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}/${PN}-0.9.0-Remove-WError.patch"
+ "${FILESDIR}/${PN}-0.9.5-slibtool.patch" # 858671
)
src_prepare() {