Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: pgsql-bugs@g.o, base-system@g.o, toolchain@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: stop using which(1)
Date: Mon, 05 Dec 2022 10:52:30
Message-Id: 20221205105153.634699-2-sam@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: stop using which(1) by Sam James
1 It's non-portable and we're looking to remove it from @system.
2
3 Bug: https://bugs.gentoo.org/646588
4 Signed-off-by: Sam James <sam@g.o>
5 ---
6 eclass/usr-ldscript.eclass | 2 +-
7 1 file changed, 1 insertion(+), 1 deletion(-)
8
9 diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
10 index a8229ed2ac2e..c821abd60846 100644
11 --- a/eclass/usr-ldscript.eclass
12 +++ b/eclass/usr-ldscript.eclass
13 @@ -70,7 +70,7 @@ gen_usr_ldscript() {
14 # If they're using gold, manually invoke the old bfd. #487696
15 local d="${T}/bfd-linker"
16 mkdir -p "${d}"
17 - ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld
18 + ln -sf $(type -P ${CHOST}-ld.bfd) "${d}"/ld
19 flags+=( -B"${d}" )
20 fi
21 output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
22 --
23 2.38.1