From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5C13F158015 for ; Tue, 26 Dec 2023 16:53:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 339182BC01E; Tue, 26 Dec 2023 16:52:57 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D0FE12BC013 for ; Tue, 26 Dec 2023 16:52:56 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] meson.eclass: Pass -Db_lto=false globally Date: Tue, 26 Dec 2023 17:52:49 +0100 Message-ID: <20231226165249.564420-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 7c1bbbc4-710a-42d4-b848-59b2c363f3af X-Archives-Hash: cad01cf39a39a618b97c8c82a51a6d2e 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 --- 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