• [gentoo-dev] [PATCH] meson.eclass: Pass -Db_lto=false globally

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Tue Dec 26 18:00:01 2023
    Pass `-Db_lto=false` globally to force-disable appending `-flto`
    in projects that default to it. In Gentoo, users enable LTO via setting `*FLAGS` manually.

    If a package really needs to pass `-Db_lto=true` because the build
    system enables some custom logic based on it, `tc-is-lto` can be used
    to determine whether LTO is enabled, and then `-Db_lto=true` can be
    passed explicitly by the ebuild.

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

    diff --git a/eclass/meson.eclass b/eclass/meson.eclass
    index f7cf8a0722ba..83bbcba40302 100644
    --- a/eclass/meson.eclass
    +++ b/eclass/meson.eclass
    @@ -334,6 +334,10 @@ meson_src_configure() {
    # It's Gentoo policy to not have builds die on blanket -Werror, as it's
    # an upstream development matter. bug #754279.
    -Dwerror=false
    +
    + # Prevent projects from enabling LTO by default. In Gentoo, LTO is
    + # enabled via setting *FLAGS appropriately.
    + -Db_lto=false
    )

    if [[ -n ${EMESON_BUILDTYPE} ]]; then
    --
    2.43.0

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