From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1317260-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 22FC31580B1
	for <garchives@archives.gentoo.org>; Wed,  1 Sep 2021 00:49:07 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 4AB3DE09D5;
	Wed,  1 Sep 2021 00:49:06 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 1FA2BE09D5
	for <gentoo-commits@lists.gentoo.org>; Wed,  1 Sep 2021 00:49:06 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 1ACD734067D
	for <gentoo-commits@lists.gentoo.org>; Wed,  1 Sep 2021 00:49:05 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 48F9795
	for <gentoo-commits@lists.gentoo.org>; Wed,  1 Sep 2021 00:49:03 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1630457335.176c1daa9c86574370fdf5ebfd23dd0edd163bdd.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/perl/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-lang/perl/perl-5.32.1.ebuild dev-lang/perl/perl-5.34.0-r1.ebuild dev-lang/perl/perl-5.34.0-r2.ebuild dev-lang/perl/perl-5.34.0.ebuild
X-VCS-Directories: dev-lang/perl/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 176c1daa9c86574370fdf5ebfd23dd0edd163bdd
X-VCS-Branch: master
Date: Wed,  1 Sep 2021 00:49:03 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: ba237b2f-c97b-44ae-a25b-acf0cf722247
X-Archives-Hash: d9fdc5390add66b4233f6cffa48de7e1

commit:     176c1daa9c86574370fdf5ebfd23dd0edd163bdd
Author:     Jeremi Piotrowski <jpiotrowski <AT> microsoft <DOT> com>
AuthorDate: Tue Aug 31 08:49:06 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep  1 00:48:55 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=176c1daa

dev-lang/perl: append required cflags when x-compiling

The cross-build system wants to append cflags required by the build to the
'optimize' variable, but doesn't touch the variable when the user overrides it.
Since the ebuild passes '-Doptimize="${CFLAGS}"', we are responsible for
passing the correct flags, so append '-fwrapv -fno-strict-aliasing' to cflags
when we are cross-compiling.

Bug: https://bugs.gentoo.org/811237
Reported-by: Github User DRKV333
Signed-off-by: Jeremi Piotrowski <jpiotrowski <AT> microsoft.com>
Closes: https://github.com/gentoo/gentoo/pull/22167
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/perl/perl-5.32.1.ebuild    | 5 +++++
 dev-lang/perl/perl-5.34.0-r1.ebuild | 5 +++++
 dev-lang/perl/perl-5.34.0-r2.ebuild | 5 +++++
 dev-lang/perl/perl-5.34.0.ebuild    | 5 +++++
 4 files changed, 20 insertions(+)

diff --git a/dev-lang/perl/perl-5.32.1.ebuild b/dev-lang/perl/perl-5.32.1.ebuild
index 149bcd1b624..97963cf4402 100644
--- a/dev-lang/perl/perl-5.32.1.ebuild
+++ b/dev-lang/perl/perl-5.32.1.ebuild
@@ -585,6 +585,11 @@ src_configure() {
 		myconf -DDEBUGGING=none
 	fi
 
+	# modifying 'optimize' prevents cross configure script from appending required flags
+	if tc-is-cross-compiler; then
+		append-cflags "-fwrapv -fno-strict-aliasing"
+	fi
+
 	# Autodiscover all old version directories, some of them will even be newer
 	# if you downgrade
 	if [[ -z ${PERL_OLDVERSEN} ]]; then

diff --git a/dev-lang/perl/perl-5.34.0-r1.ebuild b/dev-lang/perl/perl-5.34.0-r1.ebuild
index 6d709db3098..8f4017c8989 100644
--- a/dev-lang/perl/perl-5.34.0-r1.ebuild
+++ b/dev-lang/perl/perl-5.34.0-r1.ebuild
@@ -585,6 +585,11 @@ src_configure() {
 		myconf -DDEBUGGING=none
 	fi
 
+	# modifying 'optimize' prevents cross configure script from appending required flags
+	if tc-is-cross-compiler; then
+		append-cflags "-fwrapv -fno-strict-aliasing"
+	fi
+
 	# Autodiscover all old version directories, some of them will even be newer
 	# if you downgrade
 	if [[ -z ${PERL_OLDVERSEN} ]]; then

diff --git a/dev-lang/perl/perl-5.34.0-r2.ebuild b/dev-lang/perl/perl-5.34.0-r2.ebuild
index 37a81ddac84..2ec3fee9bfa 100644
--- a/dev-lang/perl/perl-5.34.0-r2.ebuild
+++ b/dev-lang/perl/perl-5.34.0-r2.ebuild
@@ -586,6 +586,11 @@ src_configure() {
 		myconf -DDEBUGGING=none
 	fi
 
+	# modifying 'optimize' prevents cross configure script from appending required flags
+	if tc-is-cross-compiler; then
+		append-cflags "-fwrapv -fno-strict-aliasing"
+	fi
+
 	# Autodiscover all old version directories, some of them will even be newer
 	# if you downgrade
 	if [[ -z ${PERL_OLDVERSEN} ]]; then

diff --git a/dev-lang/perl/perl-5.34.0.ebuild b/dev-lang/perl/perl-5.34.0.ebuild
index 6af9e5af88f..a9aa55e7376 100644
--- a/dev-lang/perl/perl-5.34.0.ebuild
+++ b/dev-lang/perl/perl-5.34.0.ebuild
@@ -582,6 +582,11 @@ src_configure() {
 		myconf -DDEBUGGING=none
 	fi
 
+	# modifying 'optimize' prevents cross configure script from appending required flags
+	if tc-is-cross-compiler; then
+		append-cflags "-fwrapv -fno-strict-aliasing"
+	fi
+
 	# Autodiscover all old version directories, some of them will even be newer
 	# if you downgrade
 	if [[ -z ${PERL_OLDVERSEN} ]]; then