public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH] meson.eclass: Pass -Db_lto=false globally
Date: Tue, 26 Dec 2023 17:52:49 +0100	[thread overview]
Message-ID: <20231226165249.564420-1-mgorny@gentoo.org> (raw)

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



                 reply	other threads:[~2023-12-26 16:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231226165249.564420-1-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox