• [gentoo-dev] [PATCH 2/4] usr-ldscript.eclass: stop using which(1)

    From Sam James@21:1/5 to All on Mon Dec 5 12:00:02 2022
    It's non-portable and we're looking to remove it from @system.

    Bug: https://bugs.gentoo.org/646588
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/usr-ldscript.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
    index a8229ed2ac2e..c821abd60846 100644
    --- a/eclass/usr-ldscript.eclass
    +++ b/eclass/usr-ldscript.eclass
    @@ -70,7 +70,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')
    --
    2.38.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)