Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941602 - app-containers/lxc does not respect CFLAGS="-flto=thin"
Summary: app-containers/lxc does not respect CFLAGS="-flto=thin"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Joonas Niilola
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-16 05:44 UTC by Sandi (Sandy) Vujaković
Modified: 2024-12-21 13:30 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandi (Sandy) Vujaković 2024-10-16 05:44:18 UTC
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
```
Comment 1 Ionen Wolkens gentoo-dev 2024-10-16 06:05:52 UTC
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.
Comment 2 Sandi (Sandy) Vujaković 2024-10-16 06:48:42 UTC
> 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.
Comment 3 Joonas Niilola gentoo-dev 2024-10-16 08:06:49 UTC
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.
Comment 4 Larry the Git Cow gentoo-dev 2024-12-21 13:30:24 UTC
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(+)