Gentoo Archives: gentoo-project

From: Sam James <sam@g.o>
To: gentoo-project@l.g.o
Subject: Re: [gentoo-project] call for agenda items -- council meeting 2021-05-09
Date: Wed, 28 Apr 2021 00:57:06
Message-Id: CD7C7AAF-017F-49C7-AFC6-F9FE6A84487A@gentoo.org
In Reply to: Re: [gentoo-project] call for agenda items -- council meeting 2021-05-09 by "Andreas K. Huettel"
1 > On 27 Apr 2021, at 19:56, Andreas K. Huettel <dilfridge@g.o> wrote:
2 >
3 > I'd like to kick off a discussion whether LTO should be considered "supported". With that I essentially mean that bugs involving LTO should be considered valid, and fixes (be it only stripping -flto from flags, or similar solutions) should be committed to the tree.
4 >
5
6 Forgive me for giving a tiny bit of unstructured opinion about USE=lto, before I dive into the actual proposal:
7
8 1) I’m really happy to use LTO whenever it is supported upstream (just like -O3, etc) but I don't use it out of thin air.
9
10 2) For that reason, I personally like it when USE=lto exists even when no specific build system hacks are required (because it tells me “upstream will help with bugs” and so on) but I completely understand this is
11 a bit at odds with what we usually do, and therefore is something I just need to get used to not having.
12
13 Of course, this problem goes away if we’re going to generally encourage tinderboxes and general LTO usage, just like we did with as-needed.
14
15 > I would like to clarify this before possibly suggesting an initiative to make the Gentoo repository LTO-safe (similar to what we did years ago with --as-needed).
16
17 I’d be interested in if slyfox or Soap had any input on heuristics to help determine if something is likely to be unsafe. LTO is really good at “provoking” undefined behaviour. Build completing means very little in terms of success here.
18
19 I don’t really want to go around running UBSAN on everything to know it’s safe to use it. Polynomial-C mentioned data corruption at runtime with some packages in #gentoo-dev the other day too (this kind of experience is very real and we need to mitigate it).
20
21 Obviously that would be a good candidate for stripping out LTO, but how are we supposed to notice this stuff if it only happens under certain circumstances?
22
23 My rough plan would be:
24 - Coordinate via e.g. wiki pages (and IRC as usual)
25 - *Strong* focus on packages with test suites so that we can get some idea of whether it’s working correctly with LTO. Let’s ignore those without tests in the first round(s).
26 - Provide some rough documentation for developers on how to build with UBSAN which we can use at least for critical applications
27 - For codebases which are known to be “rough” (and we would include feedback from the LTO overlay [0] here), we’d possibly filter LTO flags proactively (at least if they’re critical packages).
28
29 >
30 > Background is, just about every binary distribution out there builds with LTO by default now. It's not so great if we then keep telling people "LTO is dangerous".
31
32 Right. Fedora are doing this and Clear Linux has been doing this for a very long time too. What I find interesting is that I’ve never actually come
33 across any patches in either to fix LTO issues, which either means I’m (un)lucky or they’re not hitting issues so often?
34
35 Obviously, we end up hitting more than other people because of often exotic configurations on the user side, but it is what it is.
36
37 This is one of those situations where reaching out to some folks we know in other distros for some (unstructured) thoughts might not be a bad idea - just
38 to find out some e.g. heads up on problematic codebases.
39
40 Best,
41 sam
42
43 [0] https://github.com/InBetweenNames/gentooLTO
44
45 >
46 > Cheers,
47 > Andreas
48 >
49 > (Yes I'm aware of the LTO overlay. It may be a great source.)
50 >
51 > --
52 > Andreas K. Hüttel
53 > dilfridge@g.o
54 > Gentoo Linux developer
55 > (council, toolchain, base-system, perl, libreoffice)

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies