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 9C204159C96 for ; Thu, 25 Jul 2024 11:21:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 53295E2AF1; Thu, 25 Jul 2024 11:21:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 F1BBDE2A69 for ; Thu, 25 Jul 2024 11:21:01 +0000 (UTC) From: James Le Cuirot To: gentoo-dev Cc: James Le Cuirot Subject: [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local Date: Thu, 25 Jul 2024 12:19:38 +0100 Message-ID: <20240725112005.10045-9-chewi@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725112005.10045-3-chewi@gentoo.org> References: <20240725112005.10045-3-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: 50837df6-1f07-44fc-9fd9-a664e874a16b X-Archives-Hash: 31998d78365e6d202f59b26b74b00b58 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 44d3f7ee31f59..9f0bffee0e048 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -532,7 +532,16 @@ cargo_src_configure() { # host and target host respectively. Ensure these are set consistently between # Cargo invocations, otherwise rebuilds will occur. cargo_env() { + # 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