public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: James Le Cuirot <chewi@gentoo.org>
Cc: gentoo-dev <gentoo-dev@lists.gentoo.org>
Subject: Re: [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local
Date: Thu, 25 Jul 2024 12:50:30 +0100	[thread overview]
Message-ID: <87ikwtk7w9.fsf@gentoo.org> (raw)
In-Reply-To: <20240725112005.10045-9-chewi@gentoo.org> (James Le Cuirot's message of "Thu, 25 Jul 2024 12:19:38 +0100")

James Le Cuirot <chewi@gentoo.org> writes:

> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> ---
>  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
> +

Maybe mention in the commit message that this is what we do for
distutils-r1 too.


  reply	other threads:[~2024-07-25 11:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 11:19 [gentoo-dev] [PATCH 1/5 v3] cargo.eclass: Add cargo_env helper and use it in compile, test, install James Le Cuirot
2024-07-25 11:19 ` [gentoo-dev] [PATCH 2/5 v3] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better James Le Cuirot
2024-07-25 11:19 ` [gentoo-dev] [PATCH 3/5 v3] cargo.eclass: Explicitly tell rustc not to strip binaries James Le Cuirot
2024-07-25 11:19 ` [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local James Le Cuirot
2024-07-25 11:50   ` Sam James [this message]
2024-07-25 11:19 ` [gentoo-dev] [PATCH 5/5 v3] distutils-r1.eclass: Use cargo_env when appropriate for flag handling James Le Cuirot
2024-07-25 11:48 ` [gentoo-dev] [PATCH 1/5 v3] cargo.eclass: Add cargo_env helper and use it in compile, test, install Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikwtk7w9.fsf@gentoo.org \
    --to=sam@gentoo.org \
    --cc=chewi@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox