sys-devel/binutils: Sync with Gentoo

It's from Gentoo commit 6010348df47c9b5bb8e2f3305b35f82f789aca36.
This commit is contained in:
Flatcar Buildbot 2023-10-02 07:14:26 +00:00
parent f9c42b5507
commit 25ac571e94
4 changed files with 9 additions and 39 deletions

View File

@ -118,7 +118,9 @@ src_prepare() {
# This is applied conditionally for now just out of caution.
# It should be okay on non-prefix systems though. See bug #892549.
use prefix && eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
if is_cross || use prefix; then
eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
fi
fi
fi

View File

@ -118,7 +118,9 @@ src_prepare() {
# This is applied conditionally for now just out of caution.
# It should be okay on non-prefix systems though. See bug #892549.
use prefix && eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
if is_cross || use prefix; then
eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
fi
fi
fi

View File

@ -118,7 +118,9 @@ src_prepare() {
# This is applied conditionally for now just out of caution.
# It should be okay on non-prefix systems though. See bug #892549.
use prefix && eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
if is_cross || use prefix; then
eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
fi
fi
fi

View File

@ -36,39 +36,3 @@ libstdc++.so.6, while other linkers do not use this file at all.
sprintf (filename, "%s/%s", search->name, l->name);
nn.name = filename;
if (ldelf_try_needed (&nn, force, is_linux))
From 8afc65c8d8c0fff2f686ddd8eb9023c7ebabcca9 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Sat, 11 Feb 2023 15:18:58 +0000
Subject: [PATCH 2/2] ldelf.c: Do not search for libraries using ld.so.conf
Other linkers do not do this. It is problematic for Gentoo Linux,
because crossdev installs libraries such as libstdc++.so.6 outside of
the sysroot.
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -2355,7 +2355,9 @@ For a linker for a Linux system, if the file @file{/etc/ld.so.conf}
exists, the list of directories found in that file. Note: the path
to this file is prefixed with the @code{sysroot} value, if that is
defined, and then any @code{prefix} string if the linker was
-configured with the @command{--prefix=<path>} option.
+configured with the @command{--prefix=<path>} option. This has feature has
+been disabled on Gentoo Linux to make it consistent with the other
+linkers, which do not do this.
@item
For a native linker on a FreeBSD system, any directories specified by
the @code{_PATH_ELF_HINTS} macro defined in the @file{elf-hints.h}
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1156,10 +1156,6 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
if (is_freebsd
&& ldelf_check_ld_elf_hints (l, force, elfsize))
break;
-
- if (is_linux
- && ldelf_check_ld_so_conf (l, force, elfsize, prefix))
- break;
}
len = strlen (l->name);