The LXC ebuilds override `b_lto` and `b_lto_mode` in `emesonargs`. The following (line 100 in 6.0.2) causes the ebuild to disable LTO unless the `lto` USE flag is set: ``` $(meson_use lto b_lto) ``` The following (lines 121-125 in 6.0.2) causes the LTO mode to always be set to `thin` for gold and LLD and to always be set to `default` otherwise: ``` if $(tc-ld-is-gold) || $(tc-ld-is-lld); then local emesonargs+=( -Db_lto_mode=thin ) else local emesonargs+=( -Db_lto_mode=default ) fi ```
If want lto you should normally be enabling USE=lto rather than expect it to be used when these flags are unset. But this logic likely predate what meson.eclass (newly) does, aka it handles auto-detecting lto from *FLAGS + passing meson flags, but then the ebuild is duplicating the logic and having a USE for nothing. So think this can all be dropped.
> If want lto you should normally be enabling USE=lto rather than expect it to be used when these flags are unset. Isn't `lto` being phased out in favour of `-flto*` in `*FLAGS`, hence the new Meson eclass logic? That's the impression I'm under at least.
I wasn't aware meson.eclass does this. Yeah, the ebuild has had it before it was added to meson.eclass. Something to update on next version bump for sure.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe199693ea3b2b99a9e2639dcd86b537f3db1ec6 commit fe199693ea3b2b99a9e2639dcd86b537f3db1ec6 Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2024-12-21 13:24:30 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2024-12-21 13:30:21 +0000 app-containers/lxc: add 6.0.3 - drop 'lto' use flag in favor of handling it via meson.eclass. Closes: https://bugs.gentoo.org/941602 Signed-off-by: Joonas Niilola <juippis@gentoo.org> app-containers/lxc/Manifest | 2 + app-containers/lxc/lxc-6.0.3.ebuild | 168 ++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+)