[libapache2-mod-perl2] 02/12: Fix builds with gcc -O0 (DEB_BUILD_OPTIONS=noopt) by defining MP_IN_XS in APR and APR/PerlIO builds. (Closes: #756989)

Niko Tyni ntyni at moszumanska.debian.org
Thu Aug 7 20:13:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

ntyni pushed a commit to branch master
in repository libapache2-mod-perl2.

commit f99df0de7cbde73696a263f18b384434979f3efd
Author: Niko Tyni <ntyni at debian.org>
Date:   Thu Aug 7 17:26:11 2014 +0300

    Fix builds with gcc -O0 (DEB_BUILD_OPTIONS=noopt) by defining MP_IN_XS in APR and APR/PerlIO builds. (Closes: #756989)
---
 debian/changelog                                   |  2 +
 ...N_XS-to-avoid-referencing-perl_module-out.patch | 62 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 65 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2925a92..1547d7b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ libapache2-mod-perl2 (2.0.9~1604013-1) UNRELEASED; urgency=medium
   [ Niko Tyni ]
   * Drop 290-httpd-transition-test-todo.patch, issue fixed upstream.
     (Closes: #710327)
+  * Fix builds with gcc -O0 (DEB_BUILD_OPTIONS=noopt) by defining
+    MP_IN_XS in APR and APR/PerlIO builds. (Closes: #756989)
 
  -- gregor herrmann <gregoa at debian.org>  Sat, 15 Feb 2014 20:25:47 +0100
 
diff --git a/debian/patches/400-Define-MP_IN_XS-to-avoid-referencing-perl_module-out.patch b/debian/patches/400-Define-MP_IN_XS-to-avoid-referencing-perl_module-out.patch
new file mode 100644
index 0000000..e36a046
--- /dev/null
+++ b/debian/patches/400-Define-MP_IN_XS-to-avoid-referencing-perl_module-out.patch
@@ -0,0 +1,62 @@
+From f63fb4d77dcbd324d5c5ca749bf454bb981aa6d9 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Mon, 4 Aug 2014 10:32:36 +0300
+Subject: [PATCH 1/3] Define MP_IN_XS to avoid referencing &perl_module outside
+ of mod_perl
+
+APLOG_USE_MODULE(perl) expands to
+
+ extern module perl_module; static int * const aplog_module_index = &(perl_module.module_index);
+
+which makes loading APR.so impossible outside mod_perl unless
+aplog_module_index is optimized away by the compiler.
+This causes mod_perl test suite failures in t/apr-ext at "gcc -O0".
+
+See also
+ http://svn.apache.org/viewvc?view=revision&revision=68792
+ http://svn.apache.org/viewvc?view=revision&revision=1410295
+
+Upstream thread at
+ http://mail-archives.apache.org/mod_mbox/perl-dev/201408.mbox/%3C20140807115045.GA6427%40estella.local.invalid%3E
+
+Bug-Debian: https://bugs.debian.org/756989
+---
+ xs/APR/APR/Makefile.PL    | 7 +++++++
+ xs/APR/PerlIO/Makefile.PL | 3 +++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/xs/APR/APR/Makefile.PL b/xs/APR/APR/Makefile.PL
+index 8745a54..d569dde 100644
+--- a/xs/APR/APR/Makefile.PL
++++ b/xs/APR/APR/Makefile.PL
+@@ -25,6 +25,13 @@ $libs = delete $args{LIBS} if $args{LIBS};
+ 
+ my $build = ModPerl::BuildMM::build_config();
+ 
++my $ccopts = $build->ccopts;
++
++# avoid referencing &perl_module outside of mod_perl
++$ccopts .= ' -DMP_IN_XS';
++
++$args{CCFLAGS} = $ccopts;
++
+ my @apru_link_flags = $build->apru_link_flags;
+ $libs .= join ' ', @apru_link_flags if @apru_link_flags;
+ 
+diff --git a/xs/APR/PerlIO/Makefile.PL b/xs/APR/PerlIO/Makefile.PL
+index 4a8f60d..ca102bb 100644
+--- a/xs/APR/PerlIO/Makefile.PL
++++ b/xs/APR/PerlIO/Makefile.PL
+@@ -25,6 +25,9 @@ if ($build->has_large_files_conflict) {
+         : '';
+ }
+ 
++# avoid referencing &perl_module outside of mod_perl
++$ccopts .= ' -DMP_IN_XS';
++
+ ModPerl::BuildMM::WriteMakefile(
+     NAME         => 'APR::PerlIO',
+     VERSION_FROM => 'PerlIO.pm',
+-- 
+2.1.0.rc1
+
diff --git a/debian/patches/series b/debian/patches/series
index a89c1cd..de3ff39 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,3 +17,4 @@ avoid-db-linkage.patch
 360-conditional-linux-pid-module.patch
 380-Fix-reload.t-as-per-r1565579.-Reported-in-CPAN-RT-96.patch
 390-Disable-the-tree-dse-gcc-optimization-for-modperl_en.patch
+400-Define-MP_IN_XS-to-avoid-referencing-perl_module-out.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libapache2-mod-perl2.git



More information about the Pkg-perl-cvs-commits mailing list