From 517eb60522aa085338b4e9374d5a0c871c7718c3 Mon Sep 17 00:00:00 2001 From: Joey Riches Date: Mon, 27 May 2024 17:05:13 +0100 Subject: [PATCH] ypkgcontext: Build with ffat-lto-objects when using LTO In the rare case we have to ship any static files, ensure we build with fat LTO objects so we ship actually usable static files as LTO bytecode is non-portable. Any LTO bytecode will be manually stripped from archive files. --- ypkg2/ypkgcontext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ypkg2/ypkgcontext.py b/ypkg2/ypkgcontext.py index dbfd06d..a67daa0 100644 --- a/ypkg2/ypkgcontext.py +++ b/ypkg2/ypkgcontext.py @@ -41,10 +41,10 @@ SIZE_FLAGS_CLANG = "-O2" # Allow optimizing for LTO -LTO_FLAGS = "-flto=auto" +LTO_FLAGS = "-flto=auto -ffat-lto-objects" # Allow optimizing for thin-lto -THIN_LTO_FLAGS = "-flto=thin" +THIN_LTO_FLAGS = "-flto=thin -ffat-lto-objects" # Allow optimizing for ICF all (identical code folding) ICF_ALL_FLAGS = "-Wl,--icf=all"