public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
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	[thread overview]
Message-ID: <20240302161619.3329264-4-mgorny@gentoo.org> (raw)
In-Reply-To: <20240302161619.3329264-1-mgorny@gentoo.org>

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 <mgorny@gentoo.org>
---
 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



      parent reply	other threads:[~2024-03-02 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 16:16 [gentoo-dev] [PATCH 1/4] distutils-r1.eclass: Remove -Werror... hack (now in cython) Michał Górny
2024-03-02 16:16 ` [gentoo-dev] [PATCH 2/4] distutils-r1.eclass: Limit DISTUTILS_EXT logic to compile & test Michał Górny
2024-03-02 16:16 ` [gentoo-dev] [PATCH 3/4] distutils-r1.eclass: Move filter-lto into DISTUTILS_EXT block Michał Górny
2024-03-02 16:16 ` Michał Górny [this message]

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=20240302161619.3329264-4-mgorny@gentoo.org \
    --to=mgorny@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