Re: mod_perl-1.31 compilation with perl 5.14.1 fails
Salvador Ortiz Garcia <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Organization | Matías Software Group |
| Message-ID | <[email protected]> |
On 06/28/2011 05:40 AM, Torsten Förtsch wrote: > On Tuesday, June 28, 2011 11:57:47 Vincent Veyron wrote: >> Le lundi 27 juin 2011 à 16:54 -0700, Gregory Coleman a écrit : >>> hello - am getting compilation errors in building older mod_perl >>> with newer perl. Things worked as of 5.12.X, but alas, not with >>> today's 5.14.1 >>> >>> >>> >>> Any witnesses/experiences/thoughts on this? >>> >>> >> Some in this thread : >> >> http://www.gossamer-threads.com/lists/modperl/modperl/103167 > No. The point is mp1 has reached end of life as of Feb 2010: > > http://www.gossamer-threads.com/lists/modperl/modperl/101027 Is apache httpd 1.3 that reached EOL, not mp1. As far as I known the lasts comments on the topic was on February this year: http://www.gossamer-threads.com/lists/modperl/dev/102712 > There were a few incompatible code changes in perl 5.14, particularly > with SvGP and SvCV used in lvalue context, see also > > https://rt.cpan.org/Ticket/Display.html?id=64999 > > I doubt that any one of the current dev team will incorporate these > changes into mp1. Though, if someone provides patches I think there are > good chances for them to get applied especially if that someone wants to > take care of mp1 in the future and thus become a committer. From the annotated thread I understand that Phillip M. Gollucci was planning a final mp v1.32 but without given ETA. I use both apache 1.3.x and mp1 for our in-house projects so I'm collecting patches to keep both sane with recent distros. Attached the diff on the subject from *our* repo, so some line offsets may be misaligned. Regards. Salvador Ortiz.
mp1-501303.patch
(text/plain, 2.6 KB)
Index: src/modules/perl/mod_perl.c
===================================================================
--- src/modules/perl/mod_perl.c (revision 2779)
+++ src/modules/perl/mod_perl.c (revision 2861)
@@ -848,7 +848,7 @@
/* *CORE::GLOBAL::exit = \&Apache::exit */
if(gv_stashpv("CORE::GLOBAL", FALSE)) {
GV *exitgp = gv_fetchpv("CORE::GLOBAL::exit", TRUE, SVt_PVCV);
- GvCV(exitgp) = perl_get_cv("Apache::exit", TRUE);
+ GvCV_set(exitgp, perl_get_cv("Apache::exit", TRUE));
GvIMPORTED_CV_on(exitgp);
}
Index: src/modules/perl/mod_perl.h
===================================================================
--- src/modules/perl/mod_perl.h (revision 2779)
+++ src/modules/perl/mod_perl.h (revision 2861)
@@ -201,6 +201,14 @@
#define PERL_MG_UFUNC(name,ix,sv) I32 name(IV ix, SV *sv)
#endif
+/* Post 5.13.3 */
+#ifndef CvGV_set
+# define CvGV_set(cv, gv) (CvGV(cv) = (gv))
+#endif
+#ifndef GvCV_set
+# define GvCV_set(gv, cv) (GvCV(gv) = (cv))
+#endif
+
#ifdef eval_pv
# ifndef perl_eval_pv
# define perl_eval_pv eval_pv
Index: src/modules/perl/perl_config.c
===================================================================
--- src/modules/perl/perl_config.c (revision 2779)
+++ src/modules/perl/perl_config.c (revision 2861)
@@ -1721,7 +1721,7 @@
if((cv = GvCV((GV*)val)) && (GvSTASH((GV*)val) == GvSTASH(CvGV(cv)))) {
GV *gv = CvGV(cv);
cv_undef(cv);
- CvGV(cv) = gv;
+ CvGV_set(cv, gv);
GvCVGEN(gv) = 1; /* invalidate method cache */
}
}
Index: src/modules/perl/Log.xs
===================================================================
--- src/modules/perl/Log.xs (revision 2779)
+++ src/modules/perl/Log.xs (revision 2861)
@@ -10,7 +10,7 @@
static void perl_cv_alias(char *to, char *from)
{
GV *gp = gv_fetchpv(to, TRUE, SVt_PVCV);
- GvCV(gp) = perl_get_cv(from, TRUE);
+ GvCV_set(gp, perl_get_cv(from, TRUE));
}
static void ApacheLog(int level, SV *sv, SV *msg)
Index: src/modules/perl/Apache.xs
Index: Symbol/Symbol.xs
===================================================================
--- Symbol/Symbol.xs (revision 2779)
+++ Symbol/Symbol.xs (revision 2861)
@@ -2,6 +2,10 @@
#include "perl.h"
#include "XSUB.h"
+#ifndef CvGV_set
+# define CvGV_set(cv, val) (CvGV(cv) = val)
+#endif
+
#ifdef PERL_OBJECT
#define sv_name(svp) svp
#define undef(ref)
@@ -30,7 +34,7 @@
has_proto = TRUE;
cv_undef(cv);
- CvGV(cv) = gv; /* let user-undef'd sub keep its identity */
+ CvGV_set(cv,gv); /* let user-undef'd sub keep its identity */
if(has_proto)
SvPOK_on(cv); /* otherwise we get `Prototype mismatch:' */