commit:     88607de9c44a1b11017ecb7d2d5e8868c48b1695
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  6 05:44:03 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 05:44:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88607de9

toolchain-funcs.eclass: stop using which(1)

It's non-portable and we're looking to remove it from @system.

Bug: https://bugs.gentoo.org/487696
Bug: https://bugs.gentoo.org/646588
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain-funcs.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 2b52ee7ffd7c..a184887ad3b9 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -538,7 +538,7 @@ tc-ld-force-bfd() {
        # to its value (like multilib).  #545218
        local ld=$(tc-getLD "$@")
        local bfd_ld="${ld%% *}.bfd"
-       local path_ld=$(which "${bfd_ld}" 2>/dev/null)
+       local path_ld=$(type -P "${bfd_ld}" 2>/dev/null)
        [[ -e ${path_ld} ]] && export LD=${bfd_ld}
 
        # Set up LDFLAGS to select bfd based on the gcc / clang version.
@@ -1083,7 +1083,7 @@ gen_usr_ldscript() {
                # If they're using gold, manually invoke the old bfd. #487696
                local d="${T}/bfd-linker"
                mkdir -p "${d}"
-               ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld
+               ln -sf $(type -P ${CHOST}-ld.bfd) "${d}"/ld
                flags+=( -B"${d}" )
        fi
        output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 
's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')

Reply via email to