summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremi Piotrowski <jpiotrowski@microsoft.com>2021-08-31 10:49:06 +0200
committerSam James <sam@gentoo.org>2021-09-01 01:48:55 +0100
commit176c1daa9c86574370fdf5ebfd23dd0edd163bdd (patch)
treefd0f9c8c32e4ae3ecaa0b3190a0597fa5903d92c
parentsys-kernel/zen-sources: EAPI/Version bump (diff)
downloadgentoo-176c1daa.tar.gz
gentoo-176c1daa.tar.bz2
gentoo-176c1daa.zip
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@microsoft.com> Closes: https://github.com/gentoo/gentoo/pull/22167 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--dev-lang/perl/perl-5.32.1.ebuild5
-rw-r--r--dev-lang/perl/perl-5.34.0-r1.ebuild5
-rw-r--r--dev-lang/perl/perl-5.34.0-r2.ebuild5
-rw-r--r--dev-lang/perl/perl-5.34.0.ebuild5
4 files changed, 20 insertions, 0 deletions
diff --git a/dev-lang/perl/perl-5.32.1.ebuild b/dev-lang/perl/perl-5.32.1.ebuild
index 149bcd1b6243..97963cf4402c 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 6d709db3098e..8f4017c8989f 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 37a81ddac847..2ec3fee9bfad 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 6af9e5af88fe..a9aa55e7376c 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