• [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using ca

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed Jul 12 14:30:01 2023
    Strip LTO flags when cargo.eclass is inherited. This means that Rust extensions are being built, and linking them with C/C++ style LTO
    results in broken shared libraries.

    Closes: https://bugs.gentoo.org/910220
    Signed-off-by: Michał Górny <[email protected]>
    ---
    eclass/distutils-r1.eclass | 7 +++++++
    1 file changed, 7 insertions(+)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 924e83b54ad8..5f2decaa89a3 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -191,6 +191,7 @@ esac
    if [[ -z ${_DISTUTILS_R1_ECLASS} ]]; then
    _DISTUTILS_R1_ECLASS=1

    +inherit flag-o-matic
    inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs

    if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
    @@ -1836,6 +1837,12 @@ distutils-r1_run_phase() {
    local -x CYTHON_FORCE_REGEN=1
    fi

    + # Rust extensions are incompatible with C/C++ LTO compiler
    + # see e.g. https://bugs.gentoo.org/910220
    + if [[ ${_CARGO_ECLASS} ]]; then
    + filter-lto
    + fi
    +
    # How to build Python modules in different worlds...
    local ldopts
    case "${CHOST}" in
    --
    2.41.0

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