[perl] Pass -fwrapv to stricter GCC 4.9

Petr Pisar ppisar at fedoraproject.org
Thu Apr 10 15:11:44 UTC 2014


commit 654628d9a1a5731ed5ca006a581a8a631e9025d7
Author: Petr Písař <ppisar at redhat.com>
Date:   Thu Apr 10 16:04:28 2014 +0200

    Pass -fwrapv to stricter GCC 4.9

 perl-5.18.2-Pass-fwrapv-to-stricter-GCC-4.9.patch |   59 +++++++++++++++++++++
 perl.spec                                         |   11 ++++-
 2 files changed, 69 insertions(+), 1 deletions(-)
---
diff --git a/perl-5.18.2-Pass-fwrapv-to-stricter-GCC-4.9.patch b/perl-5.18.2-Pass-fwrapv-to-stricter-GCC-4.9.patch
new file mode 100644
index 0000000..110ad21
--- /dev/null
+++ b/perl-5.18.2-Pass-fwrapv-to-stricter-GCC-4.9.patch
@@ -0,0 +1,59 @@
+From a8d0bb2102bc09bfdc7e661fb159d9257474f168 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Thu, 10 Apr 2014 16:16:31 +0200
+Subject: [PATCH] Pass -fwrapv to stricter GCC 4.9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is port to 5.18.2 of the two upstream patches:
+
+commit 869747506fd0081f6c7eed149ec6f7adbcc4d5b1
+Author: H.Merijn Brand <h.m.brand at xs4all.nl>
+Date:   Wed Apr 9 11:16:55 2014 +0200
+
+    gcc 4.9 by default does some optimizations that break perl (#121505)
+
+    Patch by Tony Cook
+
+commit 00051dd553979bd2a1dee100c324b59ee76a49e7
+Author: H.Merijn Brand <h.m.brand at xs4all.nl>
+Date:   Wed Apr 9 12:31:23 2014 +0200
+
+    -fwrapv is broken prior to gcc-4.3 (googled and patched by Zefram)
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ Configure | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/Configure b/Configure
+index 37b49c8..47e7b8f 100755
+--- a/Configure
++++ b/Configure
+@@ -4520,6 +4520,22 @@ case "$gccversion" in
+     $rm -f try try.*
+ esac
+ 
++# gcc 4.9 by default does some optimizations that break perl.
++# see ticket 121505.
++#
++# The -fwrapv disables those optimizations (and probably others,) so
++# for gcc 4.9 (and later, since the optimizations probably won't go
++# away), add -fwrapv unless the user requests -fno-wrapv, which
++# disables -fwrapv, or if the user requests -fsanitize=undefined,
++# which turns the overflows -fwrapv ignores into runtime errors.
++case "$gccversion" in
++4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
++    case "$ccflags" in
++    *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
++    *) ccflags="$ccflags -fwrapv" ;;
++    esac
++esac
++
+ : What should the include directory be ?
+ echo " "
+ $echo $n "Hmm...  $c"
+-- 
+1.9.0
+
diff --git a/perl.spec b/perl.spec
index f2ea8e8..1f2be33 100644
--- a/perl.spec
+++ b/perl.spec
@@ -30,7 +30,7 @@
 Name:           perl
 Version:        %{perl_version}
 # release number must be even higher, because dual-lived modules will be broken otherwise
-Release:        297%{?dist}
+Release:        298%{?dist}
 Epoch:          %{perl_epoch}
 Summary:        Practical Extraction and Report Language
 Group:          Development/Languages
@@ -122,6 +122,10 @@ Patch22:        perl-5.18.1-Document-Math-BigInt-CalcEmu-requires-Math-BigInt.pa
 # in upstream after 5.19.1
 Patch23:        perl-5.18.2-Make-t-comp-parser.t-get-the-correct-libraries.patch
 
+# Pass -fwrapv to stricter GCC 4.9, bug #1082957, RT#121505,
+# in upstream after 5.19.10
+Patch24:        perl-5.18.2-Pass-fwrapv-to-stricter-GCC-4.9.patch
+
 # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
 Patch200:       perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
 
@@ -1909,6 +1913,7 @@ tarball from perl.org.
 %patch21 -p1
 %patch22 -p1
 %patch23 -p1
+%patch24 -p1
 %patch200 -p1
 %patch201 -p1
 
@@ -1936,6 +1941,7 @@ perl -x patchlevel.h \
     'Fedora Patch21: Fix using regular expressions containing multiple code blocks (RT#117917)' \
     'Fedora Patch22: Document Math::BigInt::CalcEmu requires Math::BigInt (CPAN RT#85015)' \
     'Fedora Patch23: Fix t/comp/parser.t not to load system modules (RT#121579)' \
+    'Fedora Patch24: Pass -fwrapv to stricter GCC 4.9 (RT#121505)' \
     'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
     'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
     %{nil}
@@ -3610,6 +3616,9 @@ sed \
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Thu Apr 10 2014 Petr Pisar <ppisar at redhat.com> - 4:5.18.2-298
+- Pass -fwrapv to stricter GCC 4.9 (bug #1082957)
+
 * Fri Apr 04 2014 Petr Pisar <ppisar at redhat.com> - 4:5.18.2-297
 - Fix t/comp/parser.t not to load system modules (bug #1084399)
 



More information about the perl-devel mailing list