• [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Make vars local before ca

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Mar 2 17:20:02 2024
    Make LTO filtering local to the compilation code. This avoids disabling
    LTO for non-Python parts of an ebuild.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 8 ++++++++
    1 file changed, 8 insertions(+)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index ee1dcef24ff6..8193d6d8ecd0 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -1828,6 +1828,14 @@ distutils-r1_run_phase() {
    # Rust extensions are incompatible with C/C++ LTO compiler
    # see e.g. https://bugs.gentoo.org/910220
    if has cargo ${INHERITED}; then
    + # see all-flag-vars in flag-o-matic.eclass
    + local -x ADAFLAGS="${ADAFLAGS}"
    + local -x CFLAGS="${CFLAGS}"
    + local -x CXXFLAGS="${CXXFLAGS}"
    + local -x CCASFLAGS="${CCASFLAGS}"
    + local -x FFLAGS="${FFLAGS}"
    + local -x FCFLAGS="${FCFLAGS}"
    + local -x LDFLAGS="${LDFLAGS}"
    filter-lto
    fi
    fi
    --
    2.44.0

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