• [gentoo-dev] [PATCH 1/7] sys-libs/glibc: Strip prefix from ld scripts f

    From James Le Cuirot@21:1/5 to All on Sat Jan 21 23:30:02 2023
    The toolchain expects to find the libc's files under its own sysroot. This sysroot is automatically prepended to paths found in ld scripts, such as those installed with glibc. We configure standalone prefix systems with a sysroot, so these paths should not be prefixed. However, Gentoo Prefix has traditionally left them prefixed and stopped the compiler from passing the sysroot to the linker instead. It is better to strip the prefix and let the sysroot do its job,
    as this makes cross-compiling much less awkward.

    prefix-guest systems do not have a sysroot applied, as they use the host's libc,
    but they would not install glibc anyway.

    This change is not needed for musl, as it does not install any ld scripts.

    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    profiles/features/prefix/standalone/profile.bashrc | 9 +--------
    sys-libs/glibc/glibc-2.36-r6.ebuild | 11 +++++++++++
    sys-libs/glibc/glibc-9999.ebuild | 11 +++++++++++
    3 files changed, 23 insertions(+), 8 deletions(-)

    diff --git a/profiles/features/prefix/standalone/profile.bashrc b/profiles/features/prefix/standalone/profile.bashrc
    index fd95e43f7f30..3cdda77b9a88 100644
    --- a/profiles/features/prefix/standalone/profile.bashrc
    +++ b/profiles/features/prefix/standalone/profile.bashrc
    @@ -1,5 +1,5 @@
    # -*- mode: shell-script; -*-
    -# Copyright 2018-2021 Gentoo Authors
    +# Copyright 2018-2022 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # RAP specific patches pending upstream:
    @@ -24,10 +24,6 @@ if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == configure ]]; the

    # use sysroot of toolchain to get correct include and library at compile time
    EXTRA_ECONF="${EXTRA_ECONF} --with-sysroot=${EPRE