* [gentoo-dev] [PATCH] meson.eclass: Pass -Db_lto=false globally
@ 2023-12-26 16:52 Michał Górny
0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2023-12-26 16:52 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Pass `-Db_lto=false` globally to force-disable appending `-flto`
in projects that default to it. In Gentoo, users enable LTO via setting
`*FLAGS` manually.
If a package really needs to pass `-Db_lto=true` because the build
system enables some custom logic based on it, `tc-is-lto` can be used
to determine whether LTO is enabled, and then `-Db_lto=true` can be
passed explicitly by the ebuild.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/meson.eclass | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index f7cf8a0722ba..83bbcba40302 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -334,6 +334,10 @@ meson_src_configure() {
# It's Gentoo policy to not have builds die on blanket -Werror, as it's
# an upstream development matter. bug #754279.
-Dwerror=false
+
+ # Prevent projects from enabling LTO by default. In Gentoo, LTO is
+ # enabled via setting *FLAGS appropriately.
+ -Db_lto=false
)
if [[ -n ${EMESON_BUILDTYPE} ]]; then
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-26 16:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-26 16:52 [gentoo-dev] [PATCH] meson.eclass: Pass -Db_lto=false globally Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox