Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38291 )
Change subject: libpayload: Add support for link time optimization ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38291/6/payloads/libpayload/Makefil... File payloads/libpayload/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/38291/6/payloads/libpayload/Makefil... PS6, Line 69: -fuse-linker-plugin -fno-fat-lto-objects
Can you add a comment here or in the commit message, why the last two switches are needed?
use-linker-plugin tells the compiler to tell the linker to use plugins, among them, the linker's LTO support. I don't think it's necessary everywhere, but some configurations are better off with it.
no-fat-lto-objects: "fat object files" are those that contain both the in-compiler data representation used for LTO and object code like "traditional" objects. I'd rather go for enforcing fat-lto-objects though: Experience on Chrome EC has shown that the compiler skips a few steps (those relevant for assembler generation) in LTO mode and with them, a bunch of warnings. See https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1648924 where we force enabled fat objects there.