summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-12-14 02:47:12 +0000
committerSam James <sam@gentoo.org>2021-12-14 02:47:12 +0000
commit710206365ed860b159d2620a28ba6e6b92145179 (patch)
tree131a2bb24b3988300b72c54d2a6a6b9198386389 /sys-devel/mold
parentsys-boot/raspberrypi-firmware: Stabilize 1.20210527 arm, #828387 (diff)
downloadgentoo-710206365ed860b159d2620a28ba6e6b92145179.tar.gz
gentoo-710206365ed860b159d2620a28ba6e6b92145179.tar.bz2
gentoo-710206365ed860b159d2620a28ba6e6b92145179.zip
sys-devel/mold: fix wrapper libdir path
Bug: https://github.com/rui314/mold/issues/127 Closes: https://bugs.gentoo.org/823653 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel/mold')
-rw-r--r--sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch26
-rw-r--r--sys-devel/mold/mold-0.9.6-r1.ebuild (renamed from sys-devel/mold/mold-0.9.6.ebuild)7
2 files changed, 33 insertions, 0 deletions
diff --git a/sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch b/sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch
new file mode 100644
index 000000000000..d8155cde8f58
--- /dev/null
+++ b/sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch
@@ -0,0 +1,26 @@
+Should be fixed with a LIBDIR variable in the next release.
+
+https://bugs.gentoo.org/823653
+https://github.com/rui314/mold/issues/127
+--- a/elf/subprocess.cc
++++ b/elf/subprocess.cc
+@@ -267,18 +267,7 @@
+
+ template <typename E>
+ std::string find_dso(Context<E> &ctx, const std::string &self) {
+- // Look for mold-wrapper.so from the same directory as the executable is.
+- std::string path = std::string(path_dirname(self)) + "/mold-wrapper.so";
+- if (is_regular_file(path))
+- return path;
+-
+- // If not exist, mold might be installed as $PREFIX/bin/mold and the
+- // DSO as $PREFIX/lib/mold/mold-wrapper.so.
+- path = path_clean(self + "/../../lib/mold/mold-wrapper.so");
+- if (is_regular_file(path))
+- return path;
+-
+- Fatal(ctx) << "mold-wrapper.so is missing";
++ return "/usr/lib64/mold/mold-wrapper.so";
+ }
+
+ template <typename E>
diff --git a/sys-devel/mold/mold-0.9.6.ebuild b/sys-devel/mold/mold-0.9.6-r1.ebuild
index 2edeabeb5579..0321cd2b708e 100644
--- a/sys-devel/mold/mold-0.9.6.ebuild
+++ b/sys-devel/mold/mold-0.9.6-r1.ebuild
@@ -26,6 +26,7 @@ DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-0.9.6-respect-flags.patch
+ "${FILESDIR}"/${PN}-0.9.6-fix-libdir-wrapper.patch
)
src_prepare() {
@@ -37,6 +38,12 @@ src_prepare() {
-e "s:\$(DEST)/lib:\$(DEST)/$(get_libdir):" \
Makefile || die
+ # Drop on next release: bug #823653
+ # https://github.com/rui314/mold/issues/127
+ sed -i \
+ -e "s:/usr/lib64/mold/mold-wrapper.so:${EPREFIX}/usr/$(get_libdir)/mold/mold-wrapper.so:" \
+
+
# Needs unpackaged dwarfutils
rm test/compressed-debug-info.sh \
test/compress-debug-sections.sh || die