summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2014-04-09 11:16:55 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2014-04-09 11:16:55 +0200
commit869747506fd0081f6c7eed149ec6f7adbcc4d5b1 (patch)
tree2af37c23a4cd41cb09d1c425da8ea6647605c93d /Configure
parentc1181d2b3683ac74700fde40596ed2533780b9b4 (diff)
downloadperl-869747506fd0081f6c7eed149ec6f7adbcc4d5b1.tar.gz
gcc 4.9 by default does some optimizations that break perl (#121505)
Patch by Tony Cook
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure18
1 files changed, 17 insertions, 1 deletions
diff --git a/Configure b/Configure
index 15b3da1769..2d01f918e4 100755
--- a/Configure
+++ b/Configure
@@ -28,7 +28,7 @@
# See Porting/pumpkin.pod for more information on metaconfig.
#
-# Generated on Sun Mar 16 09:41:42 CET 2014 [metaconfig 3.5 PL0]
+# Generated on Wed Apr 9 10:58:09 CEST 2014 [metaconfig 3.5 PL0]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
@@ -4643,6 +4643,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.9.*|4.1[0-9].*|[5-9].*)
+ case "$ccflags" in
+ *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
+ *) ccflags="$ccflags -fwrapv" ;;
+ esac
+esac
+
: What should the include directory be ?
: Use sysroot if set, so findhdr looks in the right place.
echo " "