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 6416F159C96 for ; Thu, 25 Jul 2024 18:07:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4398C2BC061; Thu, 25 Jul 2024 18:06:38 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 EDB2F2BC05E for ; Thu, 25 Jul 2024 18:06:37 +0000 (UTC) From: James Le Cuirot To: gentoo-dev Cc: rust@gentoo.org, python@gentoo.org, James Le Cuirot Subject: [gentoo-dev] [PATCH 5/6] cargo.eclass: Shadow flag variables so that LTO filtering remains local Date: Thu, 25 Jul 2024 19:02:18 +0100 Message-ID: <20240725180612.19453-6-chewi@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725180612.19453-1-chewi@gentoo.org> References: <20240725180612.19453-1-chewi@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-Transfer-Encoding: 8bit X-Archives-Salt: d6474c35-f0d5-4d83-b6a6-296aa8d7b4a8 X-Archives-Hash: 989f601e83750832a073a816a80dfda2 This is currently done for Cargo by distutils-r1.eclass. The next commit will remove that code, leaving cargo_env responsible for it. Signed-off-by: James Le Cuirot --- eclass/cargo.eclass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 84f72168fbb3c..25acf010287d8 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -549,7 +549,16 @@ cargo_env() { [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \ die "FATAL: please call cargo_gen_config before using ${FUNCNAME}" + # Shadow flag variables so that filtering below remains local. + local flag + for flag in $(all-flag-vars); do + local -x "${flag}=${!flag}" + done + + # Rust extensions are incompatible with C/C++ LTO compiler see e.g. + # https://bugs.gentoo.org/910220 filter-lto + tc-export AR CC CXX PKG_CONFIG # Set vars for cc-rs crate. -- 2.45.2