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 D3FC3159C9B for ; Tue, 6 Aug 2024 08:47:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9B0102BC057; Tue, 6 Aug 2024 08:47:19 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 80CEF2BC059 for ; Tue, 6 Aug 2024 08:47:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id CAD46342FF7 for ; Tue, 6 Aug 2024 08:47:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C42D1EC0 for ; Tue, 6 Aug 2024 08:47:16 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1722933012.1792d3396dad606e254910619c13b8509998e7e5.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/cargo.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 1792d3396dad606e254910619c13b8509998e7e5 X-VCS-Branch: master Date: Tue, 6 Aug 2024 08:47:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1b945fc1-377a-45da-92b0-32de8083a7ea X-Archives-Hash: 28425b21fa6bfdd03e140bcc693d1355 commit: 1792d3396dad606e254910619c13b8509998e7e5 Author: James Le Cuirot gentoo org> AuthorDate: Thu Jul 25 11:08:52 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Tue Aug 6 08:30:12 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1792d339 cargo.eclass: Shadow flag variables so that LTO filtering remains local 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 gentoo.org> Signed-off-by: Michał Górny gentoo.org> eclass/cargo.eclass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 99a7959b22e2..c360c2a6c419 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.