Lower Storable.xs optimization to -O2 on certain
Jarkko Hietaniemi [Fri, 22 Aug 2003 12:14:14 +0000 (12:14 +0000)]
known platforms.

p4raw-id: //depot/perl@20825

MANIFEST
ext/Storable/hints/linux.pl [new file with mode: 0644]

index 47d7111..6e5ab39 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -638,6 +638,7 @@ ext/Socket/Socket.xs                Socket extension external subroutines
 ext/Socket/t/socketpair.t      See if socketpair works
 ext/Socket/t/Socket.t          See if Socket works
 ext/Storable/ChangeLog         Storable extension
+ext/Storable/hints/linux.pl    Hint for Storable for named architecture
 ext/Storable/Makefile.PL       Storable extension
 ext/Storable/MANIFEST          Storable extension
 ext/Storable/README            Storable extension
diff --git a/ext/Storable/hints/linux.pl b/ext/Storable/hints/linux.pl
new file mode 100644 (file)
index 0000000..6401081
--- /dev/null
@@ -0,0 +1,12 @@
+# gcc -O3 (and higher) can cause Storable.xs to produce code that
+# dumps core immediately in recurse.t and retrieve.t, in is_storing()
+# and last_op_in_netorder(), respectively.  In both cases the cxt is
+# full of junk (and according to valgrind the cxt was never stack'd,
+# malloc'd or free'd).  Observed in Debian 3.0 x86, both with gccs
+# 2.95.4 20011002 and 3.3.
+use Config;
+$self->{OPTIMIZE} = '-O2'
+    if -f '/etc/debian_version' &&
+       ($Config{gccversion} =~ /^2\.95\.4 20011002 / ||
+        $Config{gccversion} eq '3.3');
+