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 C5CBF158041 for ; Sat, 2 Mar 2024 16:17:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B1582E2A39; Sat, 2 Mar 2024 16:16:28 +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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4C091E2A34 for ; Sat, 2 Mar 2024 16:16:28 +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 4/4] distutils-r1.eclass: Make vars local before calling filter-lto Date: Sat, 2 Mar 2024 17:16:19 +0100 Message-ID: <20240302161619.3329264-4-mgorny@gentoo.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240302161619.3329264-1-mgorny@gentoo.org> References: <20240302161619.3329264-1-mgorny@gentoo.org> 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: ae8837b2-46a4-46d4-9875-01c7a45464ae X-Archives-Hash: d86d4de27c3b9d02435432ca32d37056 Make LTO filtering local to the compilation code. This avoids disabling LTO for non-Python parts of an ebuild. Signed-off-by: Michał Górny --- eclass/distutils-r1.eclass | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index ee1dcef24ff6..8193d6d8ecd0 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1828,6 +1828,14 @@ distutils-r1_run_phase() { # Rust extensions are incompatible with C/C++ LTO compiler # see e.g. https://bugs.gentoo.org/910220 if has cargo ${INHERITED}; then + # see all-flag-vars in flag-o-matic.eclass + local -x ADAFLAGS="${ADAFLAGS}" + local -x CFLAGS="${CFLAGS}" + local -x CXXFLAGS="${CXXFLAGS}" + local -x CCASFLAGS="${CCASFLAGS}" + local -x FFLAGS="${FFLAGS}" + local -x FCFLAGS="${FCFLAGS}" + local -x LDFLAGS="${LDFLAGS}" filter-lto fi fi -- 2.44.0