• [gentoo-user] src_install: dobin failed while merging ebuild (17/18)

    From whiteman808@21:1/5 to All on Sun Nov 17 08:30:01 2024
    [continued from previous message]

    [[ ${columns} == 0 ]] && columns=$(set -- $( ( stty size < /dev/tty ) 2> /dev/null || echo 24 80); echo $2);
    (( columns > 0 )) || (( columns = 80 ));
    local applied d f;
    local -A _eapply_user_patches;
    local prev_shopt=$(shopt -p nullglob);
    shopt -s nullglob;
    for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{:${SLOT%/*},};
    do
    for f in "${d}"/*;
    do
    if [[ ( ${f} == *.diff || ${f} == *.patch ) && -z ${_eapply_user_patches[${f##*/}]} ]]; then
    _eapply_user_patches[${f##*/}]=${f};
    fi;
    done;
    done;
    if [[ ${#_eapply_user_patches[@]} -gt 0 ]]; then
    while read -r -d '' f; do
    f=${_eapply_user_patches[${f}]};
    if [[ -s ${f} ]]; then
    if [[ -z ${applied} ]]; then
    einfo "${PORTAGE_COLOR_INFO}$(for ((column = 0; column < ${columns} - 3; column++))
    do
    echo -n =;
    done)${PORTAGE_COLOR_NORMAL}";
    einfo "Applying user patches from ${basedir} ...";
    fi;
    eapply "${f}";
    applied=1;
    fi;
    done < <(printf -- '%s\0' "${!_eapply_user_patches[@]}" | LC_ALL=C sort -z);
    fi;
    ${prev_shopt};
    if [[ -n ${applied} ]]; then
    einfo "User patches applied.";
    einfo "${PORTAGE_COLOR_INFO}$(for ((column = 0; column < ${columns} - 3; column++))
    do
    echo -n =;
    done)${PORTAGE_COLOR_NORMAL}";
    fi
    }
    econf_build ()
    {
    local CBUILD=${CBUILD:-${CHOST}};
    function econf_env ()
    {
    CHOST=${CBUILD} econf "$@"
    };
    tc-env_build econf_env "$@"
    }
    ego ()
    {
    set -- go "$@";
    echo "$@" 1>&2;
    "$@" || die -n "${*} failed"
    }
    einstalldocs ()
    {
    ( if [[ $(declare -p DOCS 2> /dev/null) != *=* ]]; then
    local d;
    for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS FAQ CREDITS CHANGELOG;
    do
    [[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}";
    done;
    else
    if ___is_indexed_array_var DOCS; then
    [[ ${#DOCS[@]} -gt 0 ]] && docinto / && dodoc -r "${DOCS[@]}";
    else
    [[ -n ${DOCS} ]] && docinto / && dodoc -r ${DOCS};
    fi;
    fi );
    ( if ___is_indexed_array_var HTML_DOCS; then
    [[ ${#HTML_DOCS[@]} -gt 0 ]] && docinto html && dodoc -r "${HTML_DOCS[@]}";
    else
    [[ -n ${HTML_DOCS} ]] && docinto html && dodoc -r ${HTML_DOCS};
    fi )
    }
    filter-flags ()
    {
    _filter-hardened "$@";
    local v;
    for v in $(all-flag-vars);
    do
    _filter-var ${v} "$@";
    done;
    return 0
    }
    filter-ldflags ()
    {
    _filter-var LDFLAGS "$@";
    return 0
    }
    filter-lfs-flags ()
    {
    [[ $# -ne 0 ]] && die "filter-lfs-flags takes no arguments";
    filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_TIME_BITS=64
    }
    filter-lto ()
    {
    [[ $# -ne 0 ]] && die "filter-lto takes no arguments";
    filter-flags '-flto*' -fwhole-program-vtables '-fsanitize=cfi*'
    }
    filter-mfpmath ()
    {
    local orig_mfpmath new_math prune_math;
    orig_mfpmath=$(get-flag -mfpmath);
    new_math=$(get-flag mfpmath);
    new_math=${new_math/both/387,sse};
    new_math=" ${new_math//[,+]/ } ";
    prune_math="";
    for prune_math in "$@";
    do
    new_math=${new_math/ ${prune_math} / };
    done;
    new_math=$(echo ${new_math});
    new_math=${new_math// /,};
    if [[ -z ${new_math} ]]; then
    filter-flags ${orig_mfpmath};
    else
    replace-flags ${orig_mfpmath} -mfpmath=${new_math};
    fi;
    return 0
    }
    gcc-fullversion ()
    {
    _gcc_fullversion '$1.$2.$3' "$@"
    }
    gcc-major-version ()
    {
    _gcc_fullversion '$1' "$@"
    }
    gcc-micro-version ()
    {
    _gcc_fullversion '$3' "$@"
    }
    gcc-minor-version ()
    {
    _gcc_fullversion '$2' "$@"
    }
    gcc-specs-directive ()
    {
    local directive subdname subdirective;
    directive="$(_gcc-specs-directive_raw $1)";
    while [[ ${directive} == *%\(*\)* ]]; do
    subdname=${directive/*%\(};
    subdname=${subdname/\)*};
    subdirective="$(_gcc-specs-directive_raw ${subdname})";
    directive="${directive//\%(${subdname})/${subdirective}}";
    done;
    echo "${directive}";
    return 0
    }
    gcc-specs-nostrict ()
    {
    local directive;
    directive=$(gcc-specs-directive cc1);
    [[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]]
    }
    gcc-specs-now ()
    {
    local directive;
    directive=$(gcc-specs-directive link_command);
    [[ "${directive/\{!nonow:}" != "${directive}" ]]
    }
    gcc-specs-pie ()
    {
    local directive;
    directive=$(gcc-specs-directive cc1);
    [[ "${directive/\{!nopie:}" != "${directive}" ]]
    }
    gcc-specs-relro ()
    {
    local directive;
    directive=$(gcc-specs-directive link_command);
    [[ "${directive/\{!norelro:}" != "${directive}" ]]
    }
    gcc-specs-ssp ()
    {
    local directive;
    directive=$(gcc-specs-directive cc1);
    [[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]]
    }
    gcc-specs-ssp-to-all ()
    {
    local directive;
    directive=$(gcc-specs-directive cc1);
    [[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]]
    }
    gcc-specs-stack-check ()
    {
    local directive;
    directive=$(gcc-specs-directive cc1);
    [[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]
    }
    gcc-version ()
    {
    _gcc_fullversion '$1.$2' "$@"
    }
    gen_usr_ldscript ()
    {
    ewarn "${FUNCNAME}: Please migrate to usr-ldscript.eclass";
    local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname);
    tc-is-static-only && return;
    use prefix && return;
    if [[ $(type -t multilib_is_native_abi) == "function" ]]; then
    multilib_is_native_abi || return 0;
    fi;
    case ${CTARGET:-${CHOST}} in
    *-darwin*)

    ;;
    *-android*)
    return 0
    ;;
    *linux*)
    use prefix && return 0
    ;;
    *)
    return 0
    ;;
    esac;
    dodir /usr/${libdir};
    if [[ $1 == "-a" ]]; then
    auto=true;
    shift;
    dodir /${libdir};
    fi;
    local flags=(${CFLAGS} ${LDFLAGS} -Wl,--verbose);
    if $(tc-getLD) --version | grep -q 'GNU gold'; then
    local d="${T}/bfd-linker";
    mkdir -p "${d}";
    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');
    [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )";
    for lib in "$@";
    do
    local tlib;
    if ${auto}; then
    lib="lib${lib}${suffix}";
    else
    [[ -r ${ED}/${libdir}/${lib} ]] || continue;
    fi;
    case ${CTARGET:-${CHOST}} in
    *-darwin*)
    if ${auto}; then
    tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib});
    else
    tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib});
    fi;
    [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}";
    tlib=${tlib##*/};
    if ${auto}; then
    mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die;
    if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]]; then
    mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die;
    fi;
    rm -f "${ED}"/${libdir}/${lib};
    fi;
    if [[ ! -w "${ED}/${libdir}/${tlib}" ]]; then
    chmod u+w "${ED}${libdir}/${tlib}";
    local nowrite=yes;
    fi;
    install_name_tool -id "${EPREFIX}"/${libdir}/${tlib} "${ED}"/${libdir}/${tlib} || die "install_name_tool failed";
    [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}";
    pushd "${ED}/usr/${libdir}" > /dev/null;
    ln -snf "../../${libdir}/${tlib}" "${lib}";
    popd > /dev/null
    ;;
    *)
    if ${auto}; then
    tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib});
    [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}";
    mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die;
    if [[ ${tlib} != ${lib}* ]]; then
    mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die;
    fi;
    rm -f "${ED}"/${libdir}/${lib};
    else
    tlib=${lib};
    fi;
    cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
    /* GNU ld script
    Since Gentoo has critical dynamic libraries in /lib, and the static versions
    in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
    run into linking problems. This "fake" dynamic lib is a linker script that
    redirects the linker to the real lib. And yes, this works in the cross-
    compiling scenario as the sysroot-ed linker will prepend the real path.

    See bug https://bugs.gentoo.org/4411 for more info.
    */
    ${output_format}
    GROUP ( ${EPREFIX}/${libdir}/${tlib} )
    END_LDSCRIPT

    ;;
    esac
    fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms on ${lib}";
    done
    }
    get-flag ()
    {
    [[ $# -ne 1 ]] && die "usage: <flag>";
    local f var findflag="$1";
    for var in $(all-flag-vars);
    do
    for f in ${!var};
    do
    if [ "${f/${findflag}}" != "${f}" ]; then
    printf "%s\n" "${f/-${findflag}=}";
    return 0;
    fi;
    done;
    done;
    return 1
    }
    get_abi_CFLAGS ()
    {
    get_abi_var CFLAGS "$@"
    }
    get_abi_CHOST ()
    {
    get_abi_var CHOST "$@"
    }
    get_abi_CTARGET ()
    {
    get_abi_var CTARGET "$@"
    }
    get_abi_FAKE_TARGETS ()
    {
    get_abi_var FAKE_TARGETS "$@"
    }
    get_abi_LDFLAGS ()
    {
    get_abi_var LDFLAGS "$@"
    }
    get_abi_LIBDIR ()
    {
    get_abi_var LIBDIR "$@"
    }
    get_abi_var ()
    {
    local flag=$1;
    local abi=${2:-${ABI:-${DEFAULT_ABI:-default}}};
    local var="${flag}_${abi}";
    echo ${!var}
    }
    get_all_abis ()
    {
    local x order="" mvar dvar;
    mvar="MULTILIB_ABIS";
    dvar="DEFAULT_ABI";
    if [[ -n $1 ]]; then
    mvar="$1_${mvar}";
    dvar="$1_${dvar}";
    fi;
    if [[ -z ${!mvar} ]]; then
    echo "default";
    return 0;
    fi;
    for x in ${!mvar};
    do
    if [[ ${x} != ${!dvar} ]]; then
    order="${order:+${order} }${x}";
    fi;
    done;
    order="${order:+${order} }${!dvar}";
    echo ${order};
    return 0
    }
    get_all_libdirs ()
    {
    local libdirs abi;
    for abi in ${MULTILIB_ABIS};
    do
    libdirs+=" $(get_abi_LIBDIR ${abi})";
    done;
    [[ " ${libdirs} " != *" lib "* ]] && libdirs+=" lib";
    echo "${libdirs}"
    }
    get_exeext ()
    {
    case ${CHOST} in
    mingw* | *-mingw*)
    echo ".exe"
    ;;
    esac
    }
    get_install_abis ()
    {
    local x order="";
    if [[ -z ${MULTILIB_ABIS} ]]; then
    echo "default";
    return 0;
    fi;
    if [[ ${EMULTILIB_PKG} == "true" ]]; then
    for x in ${MULTILIB_ABIS};
    do
    if [[ ${x} != "${DEFAULT_ABI}" ]]; then
    has ${x} ${ABI_DENY} || order="${order} ${x}";
    fi;
    done;
    has ${DEFAULT_ABI} ${ABI_DENY} || order="${order} ${DEFAULT_ABI}";
    if [[ -n ${ABI_ALLOW} ]]; then
    local ordera="";
    for x in ${order};
    do
    if has ${x} ${ABI_ALLOW}; then
    ordera="${ordera} ${x}";
    fi;
    done;
    order=${ordera};
    fi;
    else
    order=${DEFAULT_ABI};
    fi;
    if [[ -z ${order} ]]; then
    die "The ABI list is empty. Are you using a proper multilib profile? Perhaps your USE flags or MULTILIB_ABIS are too restrictive for this package.";
    fi;
    echo ${order};
    return 0
    }
    get_libdir ()
    {
    local libdir_var="LIBDIR_${ABI}";
    local libdir="lib";
    [[ -n ${ABI} && -n ${!libdir_var} ]] && libdir=${!libdir_var};
    echo "${libdir}"
    }
    get_libname ()
    {
    local libname;
    local ver=$1;
    case ${CHOST} in
    mingw* | *-mingw*)
    libname="dll"
    ;;
    *-darwin*)
    libname="dylib"
    ;;
    *)
    libname="so"
    ;;
    esac;
    if [[ -z $* ]]; then
    echo ".${libname}";
    else
    for ver in "$@";
    do
    case ${CHOST} in
    *-darwin*)
    echo ".${ver}.${libname}"
    ;;
    *)
    echo ".${libname}.${ver}"
    ;;
    esac;
    done;
    fi
    }
    get_makeopts_jobs ()
    {
    makeopts_jobs "$(_get_all_makeopts)" "${1:-1}"
    }
    get_makeopts_loadavg ()
    {
    makeopts_loadavg "$(_get_all_makeopts)" "${1:-999}"
    }
    get_modname ()
    {
    local modname;
    local ver=$1;
    case ${CHOST} in
    *-darwin*)
    modname="bundle"
    ;;
    *)
    modname="so"
    ;;
    esac;
    echo ".${modname}"
    }
    get_nproc ()
    {
    local nproc;
    if type -P nproc &> /dev/null; then
    nproc=$(nproc);
    fi;
    if [[ -z ${nproc} ]] && type -P sysctl &> /dev/null; then
    nproc=$(sysctl -n hw.ncpu 2> /dev/null);
    fi;
    if [[ -z ${nproc} ]] && type -P python &> /dev/null; then
    nproc=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count());' 2> /dev/null);
    fi;
    if [[ -n ${nproc} ]]; then
    echo "${nproc}";
    else
    echo "${1:-1}";
    fi
    }
    go-env_go386 ()
    {
    if in_iuse cpu_flags_x86_sse2 && use cpu_flags_x86_sse2; then
    echo 'sse2';
    return;
    fi;
    if tc-cpp-is-true "defined(__SSE2__)" ${CFLAGS} ${CXXFLAGS}; then
    echo 'sse2';
    return;
    fi;
    echo 'softfloat'
    }
    go-env_goarch ()
    {
    local target=${1:-${CHOST}};
    local arch=$(tc-arch "${target}") cpu=${target%%-*};
    case "${arch}" in
    x86)
    echo 386
    ;;
    loong)
    echo loong64
    ;;
    *)
    case "${cpu}" in
    aarch64*be)
    echo arm64be
    ;;
    arm64)
    echo arm64
    ;;
    arm*b*)
    echo armbe
    ;;
    mips64*l*)
    echo mips64le
    ;;
    mips*l*)
    echo mipsle
    ;;
    powerpc64le*)
    echo ppc64le
    ;;
    arm64 | s390x)
    echo "${cpu}"
    ;;
    mips64* | riscv64* | sparc64*)
    echo "${arch}64"
    ;;
    *)
    echo "${arch}"
    ;;
    esac
    ;;
    esac
    }
    go-env_goarm ()
    {
    case "${1:-${CHOST}}" in
    armv5*)
    echo 5
    ;;
    armv6*)
    echo 6
    ;;
    armv7*)
    echo 7
    ;;
    *)
    die "unknown GOARM for ${1:-${CHOST}}"
    ;;
    esac
    }
    go-env_goos ()
    {
    local target=${1:-${CHOST}};
    case "${target}" in
    *-linux*)
    echo linux
    ;;
    *-darwin*)
    echo darwin
    ;;
    *-freebsd*)
    echo freebsd
    ;;
    *-netbsd*)
    echo netbsd
    ;;
    *-openbsd*)
    echo openbsd
    ;;
    *-solaris*)
    echo solaris
    ;;
    *-cygwin* | *-interix* | *-winnt*)
    echo windows
    ;;
    *)
    die "unknown GOOS for ${target}"
    ;;
    esac
    }
    go-env_set_compile_environment ()
    {
    tc-export CC CXX PKG_CONFIG;
    export GOARCH="$(go-env_goarch)";
    use arm && export GOARM=$(go-env_goarm);
    use x86 && export GO386=$(go-env_go386);
    has_version -b "sys-devel/gcc[debug]" && filter-lto;
    export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}";
    export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}";
    export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}";
    export CGO_LDFLAGS="${CGO_LDFLAGS:-$LDFLAGS}";
    if tc-is-gcc; then
    CGO_CFLAGS=$(CFLAGS=${CGO_CFLAGS}
    replace-flags -g3 -g
    replace-flags -ggdb3 -ggdb
    printf %s "${CFLAGS}");
    fi
    }
    go-module_live_vendor ()
    {
    debug-print-function ${FUNCNAME} "$@";
    has live ${PROPERTIES} || die "${FUNCNAME} only allowed in live ebuilds";
    [[ "${EBUILD_PHASE}" == unpack ]] || die "${FUNCNAME} only allowed in src_unpack";
    [[ -d "${S}"/vendor ]] && die "${FUNCNAME} only allowed when upstream isn't vendoring";
    pushd "${S}" >&/dev/null || die;
    ego mod vendor;
    popd >&/dev/null || die
    }
    go-module_set_globals ()
    {
    local line exts;
    local error_in_gosum=0;
    local -a gosum_errorlines;
    local newline='
    ';
    for line in "${EGO_SUM[@]}";
    do
    local module version modfile version_modfile kvs x;
    read -r module version_modfile kvs <<< "${line}";
    IFS=/ read -r version modfile x <<< "${version_modfile}";
    if [[ -n ${x} ]]; then
    error_in_gosum=1;
    gosum_errorlines+=("Bad version: ${version_modfile}");
    continue;
    fi;
    exts=();
    local errormsg='';
    case "${modfile}" in
    '')
    exts=(zip)
    ;;
    'go.mod' | '/go.mod')
    exts=(mod)
    ;;
    *)
    errormsg="Unknown modfile: line='${line}', modfile='${modfile}'"
    ;;
    esac;
    if [[ -n ${errormsg} ]]; then
    error_in_gosum=1;
    gosum_errorlines+=("${errormsg} line='${line}', modfile='${modfile}'");
    continue;
    fi;
    local re _dir lower;
    _dir="${module}";
    re='(.*)([A-Z])(.*)';
    while [[ ${_dir} =~ ${re} ]]; do
    lower='!'"${BASH_REMATCH[2],}";
    _dir="${BASH_REMATCH[1]}${lower}${BASH_REMATCH[3]}";
    done;
    for _ext in "${exts[@]}";
    do
    _reluri="${_dir}/@v/${version}.${_ext}";
    _uri="${_GOMODULE_GOPROXY_BASEURI}/${_reluri}";
    _distfile="${_reluri//\//%2F}";
    EGO_SUM_SRC_URI+=" ${_uri} -> ${_distfile}${newline}";
    _GOMODULE_GOSUM_REVERSE_MAP["${_distfile}"]="${_reluri}";
    done;
    done;
    if [[ ${error_in_gosum} != 0 ]]; then
    eerror "Trailing information in EGO_SUM in ${P}.ebuild";
    for line in "${gosum_errorlines[@]}";
    do
    eerror "${line}";
    done;
    die "Invalid EGO_SUM format";
    fi;
    readonly EGO_SUM;
    readonly EGO_SUM_SRC_URI;
    readonly _GOMODULE_GOSUM_REVERSE_MAP;
    export GOPROXY="file://${T}/go-proxy";
    _GO_MODULE_SET_GLOBALS_CALLED=1
    }
    go-module_setup_proxy ()
    {
    debug-print-function ${FUNCNAME} "$@";
    if [[ ! -n ${_GO_MODULE_SET_GLOBALS_CALLED} ]]; then
    die "go-module_set_globals must be called in global scope";
    fi;
    local goproxy_dir="${GOPROXY/file:\/\//}";
    mkdir -p "${goproxy_dir}" || die;
    local f;
    local goproxy_mod_dir;
    for f in ${A};
    do
    goproxy_mod_path="${_GOMODULE_GOSUM_REVERSE_MAP["${f}"]}";
    if [[ -n "${goproxy_mod_path}" ]]; then
    debug-print-function "Populating go proxy for ${goproxy_mod_path}";
    goproxy_mod_dir=$(dirname "${goproxy_dir}"/"${goproxy_mod_path}");
    mkdir -p "${goproxy_mod_dir}" || die;
    ln -sf "${DISTDIR}"/"${f}" "${goproxy_dir}/${goproxy_mod_path}" || die "Failed to ln";
    local v=${goproxy_mod_path};
    v="${v%.mod}";
    v="${v%.zip}";
    v="${v//*\/}";
    _go-module_gosum_synthesize_files "${goproxy_mod_dir}" "${v}";
    fi;
    done;
    _go-module_src_unpack_verify_gosum
    }
    go-module_src_unpack ()
    {
    if use amd64 || use arm || use arm64 || ( use ppc64 && [[ $(tc-endian) == "little" ]] ) || use s390 || use x86; then
    GOFLAGS="-buildmode=pie ${GOFLAGS}";
    fi;
    GOFLAGS="${GOFLAGS} -p=$(makeopts_jobs)";
    if [[ "${#EGO_SUM[@]}" -gt 0 ]]; then
    eqawarn "This ebuild uses EGO_SUM which is deprecated";
    eqawarn "Please migrate to a dependency tarball";
    eqawarn "This will become a fatal error in the future";
    _go-module_src_unpack_gosum;
    else
    if [[ "${#EGO_VENDOR[@]}" -gt 0 ]]; then
    eerror "${EBUILD} is using EGO_VENDOR which is no longer supported";
    die "Please update this ebuild";
    else
    default;
    if [[ ! -d "${S}"/vendor ]]; then
    cd "${S}";
    local nf;
    [[ -n ${NONFATAL_VERIFY} ]] && nf=nonfatal;
    ${nf} ego mod verify;
    fi;
    fi;
    fi;
    go-env_set_compile_environment
    }
    has_multilib_profile ()
    {
    [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ]
    }
    in_iuse ()
    {
    local use=${1};
    if [[ -z "${use}" ]]; then
    echo "!!! in_iuse() called without a parameter." 1>&2;
    echo "!!! in_iuse <USEFLAG>" 1>&2;
    die "in_iuse() called without a parameter";
    fi;
    local liuse=(${IUSE_EFFECTIVE});
    has "${use}" "${liuse[@]#[+-]}"
    }
    is-flag ()
    {
    is-flagq "$@" && echo true
    }
    is-flagq ()
    {
    [[ -n $2 ]] && die "Usage: is-flag <flag>";
    local var;
    for var in $(all-flag-vars);
    do
    _is_flagq ${var} "$1" && return 0;
    done;
    return 1
    }
    is-ldflag ()
    {
    is-ldflagq "$@" && echo true
    }
    is-ldflagq ()
    {
    [[ -n $2 ]] && die "Usage: is-ldflag <flag>";
    _is_flagq LDFLAGS $1
    }
    is_final_abi ()
    {
    has_multilib_profile || return 0;
    set -- $(get_install_abis);
    local LAST_ABI=$#;
    [[ ${!LAST_ABI} == ${ABI} ]]
    }
    makeopts_jobs ()
    {
    [[ $# -eq 0 ]] && set -- "$(_get_all_makeopts)";
    local jobs=$(echo " $* " | sed -r -n -e 's:.*[[:space:]](-[a-z]*j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' -e "s:.*[[:space:]](-[a-z]*j|--jobs)[[:space:]].*:${2:-$(( $(get_nproc) + 1 ))}:p");
    echo ${jobs:-1}
    }
    makeopts_loadavg ()
    {
    [[ $# -eq 0 ]] && set -- "$(_get_all_makeopts)";
    local lavg=$(echo " $* " | sed -r -n -e 's:.*[[:space:]](-[a-z]*l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+(\.[0-9]+)?)[[:space:]].*:\3:p' -e "s:.*[[:space:]](-[a-z]*l|--(load-average|max-load))[[:space:]].*:${2:-999}:p");
    echo ${lavg:-${2:-999}}
    }
    multilib_env ()
    {
    local CTARGET=${1:-${CTARGET}};
    local cpu=${CTARGET%%*-};
    if [[ ${CTARGET} = *-musl* ]]; then
    : "${MULTILIB_ABIS=default}";
    : "${DEFAULT_ABI=default}";
    export MULTILIB_ABIS DEFAULT_ABI;
    return;
    fi;
    case ${cpu} in
    aarch64*)
    export CFLAGS_arm=${CFLAGS_arm-};
    case ${cpu} in
    aarch64*be)
    export CHOST_arm="armv8b-${CTARGET#*-}"
    ;;
    *)
    export CHOST_arm="armv8l-${CTARGET#*-}"
    ;;
    esac;
    CHOST_arm=${CHOST_arm/%-gnu/-gnueabi};
    export CTARGET_arm=${CHOST_arm};
    export LIBDIR_arm="lib";
    export CFLAGS_arm64=${CFLAGS_arm64-};
    export CHOST_arm64=${CTARGET};
    export CTARGET_arm64=${CHOST_arm64};
    export LIBDIR_arm64="lib64";
    : "${MULTILIB_ABIS=arm64}";
    : "${DEFAULT_ABI=arm64}"
    ;;
    x86_64*)
    export CFLAGS_x86=${CFLAGS_x86--m32};
    export CHOST_x86=${CTARGET/x86_64/i686};
    CHOST_x86=${CHOST_x86/%-gnux32/-gnu};
    export CTARGET_x86=${CHOST_x86};
    if [[ ${SYMLINK_LIB} == "yes" ]]; then
    export LIBDIR_x86="lib32";
    else
    export LIBDIR_x86="lib";
    fi;
    export CFLAGS_amd64=${CFLAGS_amd64--m64};
    export CHOST_amd64=${CTARGET/%-gnux32/-gnu};
    export CTARGET_amd64=${CHOST_amd64};
    export LIBDIR_amd64="lib64";
    export CFLAGS_x32=${CFLAGS_x32--mx32};
    export CHOST_x32=${CTARGET/%-gnu/-gnux32};
    export CTARGET_x32=${CHOST_x32};
    export LIBDIR_x32="libx32";
    case ${CTARGET} in
    *-gnux32)
    : "${MULTILIB_ABIS=x32 amd64 x86}";
    : "${DEFAULT_ABI=x32}"
    ;;
    *)
    : "${MULTILIB_ABIS=amd64 x86}";
    : "${DEFAULT_ABI=amd64}"
    ;;
    esac
    ;;
    loongarch64*)
    export CFLAGS_lp64d=${CFLAGS_lp64d--mabi=lp64d};
    export CHOST_lp64d=${CTARGET};
    export CTARGET_lp64d=${CTARGET};
    export LIBDIR_lp64d=${LIBDIR_lp64d-lib64};
    : "${MULTILIB_ABIS=lp64d}";
    : "${DEFAULT_ABI=lp64d}"
    ;;
    mips64* | mipsisa64*)
    export CFLAGS_o32=${CFLAGS_o32--mabi=32};
    export CHOST_o32=${CTARGET/mips64/mips};
    export CHOST_o32=${CHOST_o32/mipsisa64/mipsisa32};
    export CTARGET_o32=${CHOST_o32};
    export LIBDIR_o32="lib";
    export CFLAGS_n32=${CFLAGS_n32--mabi=n32};
    export CHOST_n32=${CTARGET};
    export CTARGET_n32=${CHOST_n32};
    export LIBDIR_n32="lib32";
    export CFLAGS_n64=${CFLAGS_n64--mabi=64};
    export CHOST_n64=${CTARGET};
    export CTARGET_n64=${CHOST_n64};
    export LIBDIR_n64="lib64";
    : "${MULTILIB_ABIS=n64 n32 o32}";
    : "${DEFAULT_ABI=n32}"
    ;;
    powerpc64*)
    export CFLAGS_ppc=${CFLAGS_ppc--m32};
    export CHOST_ppc=${CTARGET/powerpc64/powerpc};
    export CTARGET_ppc=${CHOST_ppc};
    export LIBDIR_ppc="lib";
    export CFLAGS_ppc64=${CFLAGS_ppc64--m64};
    export CHOST_ppc64=${CTARGET};
    export CTARGET_ppc64=${CHOST_ppc64};
    export LIBDIR_ppc64="lib64";
    : "${MULTILIB_ABIS=ppc64 ppc}";
    : "${DEFAULT_ABI=ppc64}"
    ;;
    riscv64*)
    : "${MULTILIB_ABIS=lp64d lp64 ilp32d ilp32}";
    : "${DEFAULT_ABI=lp64d}";
    local _libdir_riscvdefaultabi_variable="LIBDIR_${DEFAULT_ABI}";
    local _libdir_riscvdefaultabi=${!_libdir_riscvdefaultabi_variable};
    export ${_libdir_riscvdefaultabi_variable}=${_libdir_riscvdefaultabi:-lib64};
    export CFLAGS_lp64d=${CFLAGS_lp64d--mabi=lp64d -march=rv64gc};
    export CHOST_lp64d=${CTARGET};
    export CTARGET_lp64d=${CTARGET};
    export LIBDIR_lp64d=${LIBDIR_lp64d-lib64/lp64d};
    export CFLAGS_lp64=${CFLAGS_lp64--mabi=lp64 -march=rv64imac};
    export CHOST_lp64=${CTARGET};
    export CTARGET_lp64=${CTARGET};
    export LIBDIR_lp64=${LIBDIR_lp64-lib64/lp64};
    export CFLAGS_ilp32d=${CFLAGS_ilp32d--mabi=ilp32d -march=rv32imafdc};
    export CHOST_ilp32d=${CTARGET/riscv64/riscv32};
    export CTARGET_ilp32d=${CTARGET/riscv64/riscv32};
    export LIBDIR_ilp32d=${LIBDIR_ilp32d-lib32/ilp32d};
    export CFLAGS_ilp32=${CFLAGS_ilp32--mabi=ilp32 -march=rv32imac};
    export CHOST_ilp32=${CTARGET/riscv64/riscv32};
    export CTARGET_ilp32=${CTARGET/riscv64/riscv32};
    export LIBDIR_ilp32=${LIBDIR_ilp32-lib32/ilp32}
    ;;
    riscv32*)
    : "${MULTILIB_ABIS=ilp32d ilp32}";
    : "${DEFAULT_ABI=ilp32d}";
    local _libdir_riscvdefaultabi_variable="LIBDIR_${DEFAULT_ABI}";
    local _libdir_riscvdefaultabi=${!_libdir_riscvdefaultabi_variable};
    export ${_libdir_riscvdefaultabi_variable}=${_libdir_riscvdefaultabi:-lib};
    export CFLAGS_ilp32d=${CFLAGS_ilp32d--mabi=ilp32d -march=rv32imafdc};
    export CHOST_ilp32d=${CTARGET};
    export CTARGET_ilp32d=${CTARGET};
    export LIBDIR_ilp32d=${LIBDIR_ilp32d-lib32/ilp32d};
    export CFLAGS_ilp32=${CFLAGS_ilp32--mabi=ilp32 -march=rv32imac};
    export CHOST_ilp32=${CTARGET};
    export CTARGET_ilp32=${CTARGET};
    export LIBDIR_ilp32=${LIBDIR_ilp32-lib32/ilp32}
    ;;
    s390x*)
    export CFLAGS_s390=${CFLAGS_s390--m31};
    export CHOST_s390=${CTARGET/s390x/s390};
    export CTARGET_s390=${CHOST_s390};
    export LIBDIR_s390="lib";
    export CFLAGS_s390x=${CFLAGS_s390x--m64};
    export CHOST_s390x=${CTARGET};
    export CTARGET_s390x=${CHOST_s390x};
    export LIBDIR_s390x="lib64";
    : "${MULTILIB_ABIS=s390x s390}";
    : "${DEFAULT_ABI=s390x}"
    ;;
    sparc64*)
    export CFLAGS_sparc32=${CFLAGS_sparc32--m32};
    export CHOST_sparc32=${CTARGET/sparc64/sparc};
    export CTARGET_sparc32=${CHOST_sparc32};
    export LIBDIR_sparc32="lib";
    export CFLAGS_sparc64=${CFLAGS_sparc64--m64};
    export CHOST_sparc64=${CTARGET};
    export CTARGET_sparc64=${CHOST_sparc64};
    export LIBDIR_sparc64="lib64";
    : "${MULTILIB_ABIS=sparc64 sparc32}";
    : "${DEFAULT_ABI=sparc64}"
    ;;
    *)
    : "${MULTILIB_ABIS=default}";
    : "${DEFAULT_ABI=default}"
    ;;
    esac;
    export MULTILIB_ABIS DEFAULT_ABI
    }
    multilib_toolchain_setup ()
    {
    local v vv;
    export ABI=$1;
    local save_restore_variables=(CBUILD CHOST AR CC CXX F77 FC LD NM OBJCOPY OBJDUMP PKG_CONFIG RANLIB READELF STRINGS STRIP PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH);
    if [[ ${_DEFAULT_ABI_SAVED} == "true" ]]; then
    for v in "${save_restore_variables[@]}";
    do
    vv="_abi_saved_${v}";
    [[ ${!vv+set} == "set" ]] && export ${v}="${!vv}" || unset ${v};
    unset ${vv};
    done;
    unset _DEFAULT_ABI_SAVED;
    fi;
    if [[ ${ABI} != ${DEFAULT_ABI} ]]; then
    for v in "${save_restore_variables[@]}";
    do
    vv="_abi_saved_${v}";
    [[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv};
    done;
    export _DEFAULT_ABI_SAVED="true";
    if [[ ${CBUILD} == "${CHOST}" ]]; then
    export CBUILD=$(get_abi_CHOST $1);
    fi;
    export CHOST=$(get_abi_CHOST ${DEFAULT_ABI});
    export AR="$(tc-getAR)";
    export CC="$(tc-getCC) $(get_abi_CFLAGS)";
    export CXX="$(tc-getCXX) $(get_abi_CFLAGS)";
    export F77="$(tc-getF77) $(get_abi_CFLAGS)";
    export FC="$(tc-getFC) $(get_abi_CFLAGS)";
    export LD="$(tc-getLD) $(get_abi_LDFLAGS)";
    export NM="$(tc-getNM)";
    export OBJCOPY="$(tc-getOBJCOPY)";
    export OBJDUMP="$(tc-getOBJDUMP)";
    export PKG_CONFIG="$(tc-getPKG_CONFIG)";
    export RANLIB="$(tc-getRANLIB)";
    export READELF="$(tc-getREADELF)";
    export STRINGS="$(tc-getSTRINGS)";
    export STRIP="$(tc-getSTRIP)";
    export CHOST=$(get_abi_CHOST $1);
    export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig;
    export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig;
    export PKG_CONFIG_SYSTEM_INCLUDE_PATH=${EPREFIX}/usr/include;
    export PKG_CONFIG_SYSTEM_LIBRARY_PATH=${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir);
    fi
    }
    no-as-needed ()
    {
    [[ $# -ne 0 ]] && die "no-as-needed takes no arguments";
    case $($(tc-getLD) -v 2>&1 < /dev/null) in
    *GNU*)
    echo "-Wl,--no-as-needed"
    ;;
    esac
    }
    number_abis ()
    {
    set -- `get_install_abis`;
    echo $#
    }
    pkg_nofetch ()
    {
    default
    }
    raw-ldflags ()
    {
    local x input="$@";
    [[ -z ${input} ]] && input=${LDFLAGS};
    set --;
    for x in ${input};
    do
    case ${x} in
    -Wl,*)

    [continued in next message]

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