You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by John Peacock <jp...@rowman.com> on 2003/09/23 20:36:02 UTC

Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

I am building a new server (FreeBSD 4.8-RELEASE) and wanted to get mod_perl2 
working.  If I use the /usr/ports/www/mod_perl2 and /usr/ports/lang/perl5.8, I 
can build mod_perl and it works like a charm.  However, nothing I do with with 
Perl5.8.1_rc5 works.

With the mod_perl2 CVS, I get this error:

modperl_filter.c: In function `modperl_run_filter_init':
modperl_filter.c:363: syntax error before `extern'
modperl_filter.c: In function `modperl_run_filter':
modperl_filter.c:435: syntax error before `extern'

Both of those lines are MP_dINTERP_PUTBACK(interp) and I get lost in a maze of 
#define's. :~(

With mod_perl-2.0-current.tar.gz from one of the mirrors, or with the FreeBSD 
port, I get this:

...lots of successful compilations...

rm -f mod_perl.so
ld -shared  -L/usr/local/lib    mod_perl.lo modperl_interp.lo modperl_tipool.lo 
modperl_log.lo modperl_config.lo modperl_cmd.lo modperl_options.lo 
modperl_callback.lo modperl_handler.lo modperl_gtop.lo modperl_util.lo 
modperl_io.lo modperl_filter.lo modperl_bucket.lo modperl_mgv.lo modperl_pcw.lo 
modperl_global.lo modperl_env.lo modperl_cgi.lo modperl_perl.lo 
modperl_perl_global.lo modperl_perl_pp.lo modperl_sys.lo modperl_module.lo 
modperl_svptr_table.lo modperl_const.lo modperl_constants.lo modperl_hooks.lo 
modperl_directives.lo modperl_flags.lo modperl_xsinit.lo  -Wl,-E 
-L/usr/local/lib /usr/local/lib/perl5/5.8.1/mach/auto/DynaLoader/DynaLoader.a 
-L/usr/local/lib/perl5/5.8.1/mach/CORE -lperl -lm -lcrypt -lutil -lc  -o mod_perl.so
/usr/libexec/elf/ld: unrecognized option '-Wl,-E'
/usr/libexec/elf/ld: use the --help option for usage information

because the -Wl is the cc option that should have been stripped before passing 
the -E to ld. :~(

I hacked together a Perl 5.8.1 FreeBSD port so this is identical to the existing 
5.8.0 port:

# perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
   Platform:
     osname=freebsd, osvers=4.8-release, archname=i386-freebsd
     uname='freebsd website2.rlpgbooks.com 4.8-release freebsd 4.8-release #0: 
thu apr 3 10:53:38 gmt 2003 root@freebsd-stable.sentex.ca:usrobjusrsrcsysgeneric 
i386 '
     config_args='-sde -Dprefix=/usr/local 
-Darchlib=/usr/local/lib/perl5/5.8.1/mach -Dprivlib=/usr/local/lib/perl5/5.8.1 
-Dman3dir=/usr/local/lib/perl5/5.8.1/man/man3 
-Dsitearch=/usr/local/lib/perl5/site_perl/5.8.1/mach 
-Dsitelib=/usr/local/lib/perl5/site_perl/5.8.1 -Ui_malloc -Ui_iconv 
-Uinstallusrbinperl -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.1/BSDPAN" 
-Ui_gdbm -Dusemymalloc=n'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.1/BSDPAN" 
-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include',
     optimize='-O -pipe ',
     cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.1/BSDPAN" -DHAS_FPSETMASK 
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include'
     ccversion='', gccversion='2.95.4 20020320 [FreeBSD]', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
     libpth=/usr/lib /usr/local/lib
     libs=-lm -lcrypt -lutil -lc
     perllibs=-lm -lcrypt -lutil -lc
     libc=, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
     cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: USE_LARGE_FILES
   Locally applied patches:
         MAINT21250
   Built under freebsd
   Compiled at Sep 23 2003 12:44:58
   @INC:
     /usr/local/lib/perl5/5.8.1/BSDPAN
     /usr/local/lib/perl5/5.8.1/mach
     /usr/local/lib/perl5/5.8.1
     /usr/local/lib/perl5/site_perl/5.8.1/mach
     /usr/local/lib/perl5/site_perl/5.8.1
     /usr/local/lib/perl5/site_perl/5.8.0
     /usr/local/lib/perl5/site_perl/5.005
     /usr/local/lib/perl5/site_perl
     .


John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748




Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
>> -#define MP_dINTERP_PUTBACK(interp) dNOOP
>> +#define MP_INTERP_PUTBACK(interp) NOOP
> 
> 
> ah, I missed the dNOOP change and only saw the name change :)
> 
>> I'm looking forward for mandrake cooker gcc picking up the changes 
>> from the end of july where the gcc team has added a new flag that will 
>> complain about declarations after code, so we will be able to catch 
>> this problem before committing things.
> 
> 
> we should add that to maintainer mode when it arrives.
> 
> I'll have to remember to update my RH too :)

It's -Wdeclaration-after-statement, added Mon Jul 28 20:15:44 2003.
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?r1=2.639&r2=2.640&f=h

We probably should turn it on if gcc-3.3.2 is used (which is not released yet).

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> -#define MP_dINTERP_PUTBACK(interp) dNOOP
> +#define MP_INTERP_PUTBACK(interp) NOOP

ah, I missed the dNOOP change and only saw the name change :)

> I'm looking forward for mandrake cooker gcc picking up the changes from 
> the end of july where the gcc team has added a new flag that will 
> complain about declarations after code, so we will be able to catch this 
> problem before committing things.

we should add that to maintainer mode when it arrives.

I'll have to remember to update my RH too :)

--Geoff



Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
>> -#ifdef USE_ITHREADS
>> -    MP_dINTERP_PUTBACK(interp);
>> -#endif
>> +    MP_INTERP_PUTBACK(interp);
> 
> 
> yeah, that makes sense - the macro is already a no-op for non-threaded 
> perls.
> 
> but why the name change?  it parallels MP_dINTERP_SELECT as it stands now.

That's exactly the mistake 'd' stands for declare, and MP_INTERP_PUTBACK is 
placed after code where you can't declare variables, neither you do declare them.

Notice:

--- src/modules/perl/modperl_interp.h    13 Sep 2003 20:35:33 -0000    1.19
+++ src/modules/perl/modperl_interp.h    23 Sep 2003 19:17:22 -0000
[...[
-#define MP_dINTERP_PUTBACK(interp) dNOOP
+#define MP_INTERP_PUTBACK(interp) NOOP

if you look at dNOOP, it's:

#define dNOOP extern int Perl___notused PERL_UNUSED_DECL

something that you don't want to put after code.

I'm looking forward for mandrake cooker gcc picking up the changes from the 
end of july where the gcc team has added a new flag that will complain about 
declarations after code, so we will be able to catch this problem before 
committing things. It's not the first time we get bitten by gcc on linux 
allowing declarations after code.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> -#ifdef USE_ITHREADS
> -    MP_dINTERP_PUTBACK(interp);
> -#endif
> +    MP_INTERP_PUTBACK(interp);

yeah, that makes sense - the macro is already a no-op for non-threaded perls.

but why the name change?  it parallels MP_dINTERP_SELECT as it stands now.

--Geoff


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
>>
>> Good, but it's not the real fix, can you please revert that patch and 
>> try a new patch at the end of this file? Thanks.
> 
> 
> Reverted, patched, compiled, tested, installed!  I really wish I had 
> sent my message yesterday, so I wouldn't have flopped around quite so 
> much on my own...

Thanks John, committed


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by John Peacock <jp...@rowman.com>.
Stas Bekman wrote:

> 
> Good, but it's not the real fix, can you please revert that patch and 
> try a new patch at the end of this file? Thanks.

Reverted, patched, compiled, tested, installed!  I really wish I had sent my 
message yesterday, so I wouldn't have flopped around quite so much on my own...

John

p.s. now to get Mason working with mp2 and then get Subversion built...

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> Stas Bekman wrote:
> 
>>
>> Yup, I know, Carl has reported this earlier, but never followed up on 
>> my suggestion. Please try this patch:
> 
> 
> Excellent!  That gets it building and all the tests pass!

Good, but it's not the real fix, can you please revert that patch and try a 
new patch at the end of this file? Thanks.

>>> because the -Wl is the cc option that should have been stripped 
>>> before passing the -E to ld. :~(
>>
>>
>>
>> Yup, that's a known issue, caused by a recent change in MakeMaker and 
>> fixed in the mp2 cvs. You can probably fix it in 1.99_09 with this patch:
>> http://marc.theaimsgroup.com/?l=apache-modperl-cvs&m=106390946300985&w=2
>>
> 
> and that fixes the other problem.  Please doing business with you sir! ;~)

That was Geoff's fix ;)

--------------------------------------

Index: src/modules/perl/modperl_callback.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
retrieving revision 1.58
diff -u -r1.58 modperl_callback.c
--- src/modules/perl/modperl_callback.c	18 Sep 2003 07:46:26 -0000	1.58
+++ src/modules/perl/modperl_callback.c	23 Sep 2003 19:17:22 -0000
@@ -268,9 +268,7 @@
      SvREFCNT_dec((SV*)av_args);

      /* PerlInterpScope handler */
-#ifdef USE_ITHREADS
-    MP_dINTERP_PUTBACK(interp);
-#endif
+    MP_INTERP_PUTBACK(interp);

      return status;
  }
Index: src/modules/perl/modperl_filter.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.68
diff -u -r1.68 modperl_filter.c
--- src/modules/perl/modperl_filter.c	18 Sep 2003 07:34:21 -0000	1.68
+++ src/modules/perl/modperl_filter.c	23 Sep 2003 19:17:22 -0000
@@ -360,7 +360,7 @@

      SvREFCNT_dec((SV*)args);

-    MP_dINTERP_PUTBACK(interp);
+    MP_INTERP_PUTBACK(interp);

      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
                 "return: %d\n", handler->name, status);
@@ -432,7 +432,7 @@
          MP_FAILURE_CROAK(modperl_output_filter_flush(filter));
      }

-    MP_dINTERP_PUTBACK(interp);
+    MP_INTERP_PUTBACK(interp);

      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
                 "return: %d\n", handler->name, status);
Index: src/modules/perl/modperl_interp.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.h,v
retrieving revision 1.19
diff -u -r1.19 modperl_interp.h
--- src/modules/perl/modperl_interp.h	13 Sep 2003 20:35:33 -0000	1.19
+++ src/modules/perl/modperl_interp.h	23 Sep 2003 19:17:22 -0000
@@ -50,7 +50,7 @@
      interp = modperl_interp_select(r, c, s); \
      aTHX = interp->perl

-#define MP_dINTERP_PUTBACK(interp) \
+#define MP_INTERP_PUTBACK(interp) \
      if (interp && MpInterpPUTBACK(interp)) { \
          modperl_interp_unselect(interp); \
      }
@@ -77,7 +77,7 @@

  #define MP_dINTERP_SELECT(r, c, s) dNOOP

-#define MP_dINTERP_PUTBACK(interp) dNOOP
+#define MP_INTERP_PUTBACK(interp) NOOP

  #define MP_aTHX 0




__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by John Peacock <jp...@rowman.com>.
Stas Bekman wrote:

> 
> Yup, I know, Carl has reported this earlier, but never followed up on my 
> suggestion. Please try this patch:

Excellent!  That gets it building and all the tests pass!

>>
>> because the -Wl is the cc option that should have been stripped before 
>> passing the -E to ld. :~(
> 
> 
> Yup, that's a known issue, caused by a recent change in MakeMaker and 
> fixed in the mp2 cvs. You can probably fix it in 1.99_09 with this patch:
> http://marc.theaimsgroup.com/?l=apache-modperl-cvs&m=106390946300985&w=2
> 

and that fixes the other problem.  Please doing business with you sir! ;~)

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748


Re: Problems compile mod_perl2 on FreeBSD and Perl 5.8.1

Posted by Stas Bekman <st...@stason.org>.
John Peacock wrote:
> I am building a new server (FreeBSD 4.8-RELEASE) and wanted to get 
> mod_perl2 working.  If I use the /usr/ports/www/mod_perl2 and 
> /usr/ports/lang/perl5.8, I can build mod_perl and it works like a 
> charm.  However, nothing I do with with Perl5.8.1_rc5 works.
> 
> With the mod_perl2 CVS, I get this error:
> 
> modperl_filter.c: In function `modperl_run_filter_init':
> modperl_filter.c:363: syntax error before `extern'
> modperl_filter.c: In function `modperl_run_filter':
> modperl_filter.c:435: syntax error before `extern'
> 
> Both of those lines are MP_dINTERP_PUTBACK(interp) and I get lost in a 
> maze of #define's. :~(

Yup, I know, Carl has reported this earlier, but never followed up on my 
suggestion. Please try this patch:

Index: src/modules/perl/modperl_filter.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.68
diff -u -r1.68 modperl_filter.c
--- src/modules/perl/modperl_filter.c   18 Sep 2003 07:34:21 -0000      1.68
+++ src/modules/perl/modperl_filter.c   23 Sep 2003 18:39:45 -0000
@@ -360,7 +360,9 @@

      SvREFCNT_dec((SV*)args);

+#ifdef USE_ITHREADS
      MP_dINTERP_PUTBACK(interp);
+#endif

      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
                 "return: %d\n", handler->name, status);
@@ -432,7 +434,9 @@
          MP_FAILURE_CROAK(modperl_output_filter_flush(filter));
      }

+#ifdef USE_ITHREADS
      MP_dINTERP_PUTBACK(interp);
+#endif

      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT
                 "return: %d\n", handler->name, status);


> With mod_perl-2.0-current.tar.gz from one of the mirrors, or with the 
> FreeBSD port, I get this:
> 
> ...lots of successful compilations...
> 
> rm -f mod_perl.so
> ld -shared  -L/usr/local/lib    mod_perl.lo modperl_interp.lo 
> modperl_tipool.lo modperl_log.lo modperl_config.lo modperl_cmd.lo 
> modperl_options.lo modperl_callback.lo modperl_handler.lo 
> modperl_gtop.lo modperl_util.lo modperl_io.lo modperl_filter.lo 
> modperl_bucket.lo modperl_mgv.lo modperl_pcw.lo modperl_global.lo 
> modperl_env.lo modperl_cgi.lo modperl_perl.lo modperl_perl_global.lo 
> modperl_perl_pp.lo modperl_sys.lo modperl_module.lo 
> modperl_svptr_table.lo modperl_const.lo modperl_constants.lo 
> modperl_hooks.lo modperl_directives.lo modperl_flags.lo 
> modperl_xsinit.lo  -Wl,-E -L/usr/local/lib 
> /usr/local/lib/perl5/5.8.1/mach/auto/DynaLoader/DynaLoader.a 
> -L/usr/local/lib/perl5/5.8.1/mach/CORE -lperl -lm -lcrypt -lutil -lc  -o 
> mod_perl.so
> /usr/libexec/elf/ld: unrecognized option '-Wl,-E'
> /usr/libexec/elf/ld: use the --help option for usage information
> 
> because the -Wl is the cc option that should have been stripped before 
> passing the -E to ld. :~(

Yup, that's a known issue, caused by a recent change in MakeMaker and fixed in 
the mp2 cvs. You can probably fix it in 1.99_09 with this patch:
http://marc.theaimsgroup.com/?l=apache-modperl-cvs&m=106390946300985&w=2



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com