Mailing List Archive

Trouble compiling modperl with FreeBSD11
Hey everyone,
I work at a company where we do all our development under ModPerl and
FreeBSD servers. Its been a few years since I've been able to compile
mod-perl in FreeBSD. Everytime I need a new webserver I need to install
FreeBSD9 and Perl 5.22. This has gradually been causing me more and more
problems with server maintenance. Im hoping somebody can help me work this
out. And ideally this can be resolved for other users, I've googled a bunch
and it seems like Im not the only one going through this.

*Heres what Im doing *
*=================*

tar xzfv perl-5.26.0.tar.gz
cd perl-5.26.0
sh Configure -Dusethreads -des -A ccflags=-fPIC -Dprefix=/usr/local/perl
-Duseperlio
make
make test
make install

*This works and I get a working perl5.26 binary, which I then symlink to
/usr/local/bin and /usr/bin*

*===================*
tar xzfv httpd-2.4.27.tar.bz2
tar xzfv mod_perl-2.0.10.tar.gz
cd mod_perl-2.0.10

perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/usr/local/src/httpd-2.4.27 \
MP_AP_CONFIGURE="--prefix=/usr/local/apache --with-mpm=prefork"

*this produces the following error : *
*============================*

Checking if your kit is complete...

Looks good

ERROR from evaluation of
/usr/local/src/mod_perl-2.0.10/Apache-Reload/Makefile.PL:
Use of uninitialized value $v in substitution (s///) at
Apache-Test/lib/Apache/TestRun.pm line 1100.

*So I need to edit Apache-Test/lib/Apache/TestRun.pm and comment the
offending 2 lines *

*=====================================================*

my %args = @Apache::TestMM::Argv;
while (my($k, $v) = each %args) {
# $v =~ s/\|/\\|/g;
# $body .= "\n\$Apache::TestConfig::Argv{'$k'} = q|$v|;\n";
}

*Run the Makefile.pl again :*
*=====================*

perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/usr/local/src/httpd-2.4.27 \
MP_AP_CONFIGURE="--prefix=/usr/local/apache --with-mpm=prefork"

*This works*
*==========*

Writing Makefile for mod_perl2
Writing MYMETA.yml and MYMETA.json
[warning] mod_perl static library will be built as mod_perl.a

*Try to run make*
*=============*

2 warnings generated.
In file included from modperl_apr_perlio.c:19:
In file included from /usr/local/src/mod_perl-2.0.
10/src/modules/perl/mod_perl.h:89:
/usr/local/src/mod_perl-2.0.10/src/modules/perl/modperl_global.h:21:5:
warning: macro expansion producing 'defined' has undefined behavior
[-Wexpansion-to-defined]
#if MP_THREADED
^
/usr/local/src/mod_perl-2.0.10/src/modules/perl/mod_perl.h:27:22: note:
expanded from macro 'MP_THREADED'
#define MP_THREADED (defined(USE_ITHREADS) && APR_HAS_THREADS)
^
In file included from modperl_apr_perlio.c:19:
In file included from /usr/local/src/mod_perl-2.0.
10/src/modules/perl/mod_perl.h:89:
/usr/local/src/mod_perl-2.0.10/src/modules/perl/modperl_global.h:29:5:
warning: macro expansion producing 'defined' has undefined behavior
[-Wexpansion-to-defined]
#if MP_THREADED
^
/usr/local/src/mod_perl-2.0.10/src/modules/perl/mod_perl.h:27:22: note:
expanded from macro 'MP_THREADED'
#define MP_THREADED (defined(USE_ITHREADS) && APR_HAS_THREADS)
^
2 warnings generated.
make[3]: don't know how to make static. Stop

*Before this theres a lot of warnings that say : *
*=====================================*

warning: macro expansion producing 'defined' has undefined behavior
[-Wexpansion-to-defined]

==============

Ive tried a bunch of things Ive found in google but cant get it to
compile. I also tried going the APXS route ( which I don't like, but if
thats the only option then Ill do it ). But that also fails to compile.

===============

The FreeBSD port compiles, but It uses APXS, installs binaries and
libraries all over the place, adds on a million apache modules, and has
other issues.

================

Any help will be very much appreciated, Ive been banging my head against
the wall for a week with this.


Thank you!
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
You should be able to use newer versions of Perl...

On my production systems, I'm using mod_perl v2.0.10 with Perl v5.24
and libapreq v2.13 with Apache HTTPd v2.4.

On my test systems, I'm using mod_perl v2.0.10 with Perl v5.26 and
libapreq v2.13 with Apache HTTPd v2.4.

We're also using cached DBI connections and prepared statements with
PostgreSQL, various DNS libraries, and also manipulating images with
the PerlMagick libraries immediately upon users uploading them, so
there is much more than basic functionality being utilized (just in
case you were wondering about going beyond a basic installation).

The difference for me is that I'm using pre-build 64-bit code via
the "pkgin" tool. Perhaps there's an option with FreeBSD's package
installer to limit the installation of additional modules? I'm quite
surprised that there are a lot of other modules being installed by
default.

If it wasn't due to a compilation issue, then switching to a
different MPM could be one option, but it seems that you're not even
getting that far with it (unfortunately).

> Hey everyone,
> I work at a company where we do all our development under ModPerl and
> FreeBSD servers. Its been a few years since I've been able to compile
> mod-perl in FreeBSD. Everytime I need a new webserver I need to install
> FreeBSD9 and Perl 5.22. This has gradually been causing me more and more
> problems with server maintenance. Im hoping somebody can help me work this
> out. And ideally this can be resolved for other users, I've googled a bunch
> and it seems like Im not the only one going through this.
>
> *Heres what Im doing *
> *=================*
>
> tar xzfv perl-5.26.0.tar.gz
> cd perl-5.26.0
> sh Configure -Dusethreads -des -A ccflags=-fPIC -Dprefix=/usr/local/perl
> -Duseperlio
> make
> make test
> make install
>
> *This works and I get a working perl5.26 binary, which I then symlink to
> /usr/local/bin and /usr/bin*
>
> *===================*
> tar xzfv httpd-2.4.27.tar.bz2
> tar xzfv mod_perl-2.0.10.tar.gz
> cd mod_perl-2.0.10
>
> perl Makefile.PL MP_USE_STATIC=1 \
> MP_AP_PREFIX=/usr/local/src/httpd-2.4.27 \
> MP_AP_CONFIGURE="--prefix=/usr/local/apache --with-mpm=prefork"
>
> *this produces the following error : *
> *============================*
>
> Checking if your kit is complete...
>
> Looks good
>
> ERROR from evaluation of
> /usr/local/src/mod_perl-2.0.10/Apache-Reload/Makefile.PL:
> Use of uninitialized value $v in substitution (s///) at
> Apache-Test/lib/Apache/TestRun.pm line 1100.
>
> *So I need to edit Apache-Test/lib/Apache/TestRun.pm and comment the
> offending 2 lines *
>
> *=====================================================*
>
> my %args = @Apache::TestMM::Argv;
> while (my($k, $v) = each %args) {
> # $v =~ s/\|/\\|/g;
> # $body .= "\n\$Apache::TestConfig::Argv{'$k'} = q|$v|;\n";
> }
>
> *Run the Makefile.pl again :*
> *=====================*
>
> perl Makefile.PL MP_USE_STATIC=1 \
> MP_AP_PREFIX=/usr/local/src/httpd-2.4.27 \
> MP_AP_CONFIGURE="--prefix=/usr/local/apache --with-mpm=prefork"
>
> *This works*
> *==========*
>
> Writing Makefile for mod_perl2
> Writing MYMETA.yml and MYMETA.json
> [warning] mod_perl static library will be built as mod_perl.a
>
> *Try to run make*
> *=============*
>
> 2 warnings generated.
> In file included from modperl_apr_perlio.c:19:
> In file included from /usr/local/src/mod_perl-2.0.
> 10/src/modules/perl/mod_perl.h:89:
> /usr/local/src/mod_perl-2.0.10/src/modules/perl/modperl_global.h:21:5:
> warning: macro expansion producing 'defined' has undefined behavior
> [-Wexpansion-to-defined]
> #if MP_THREADED
> ^
> /usr/local/src/mod_perl-2.0.10/src/modules/perl/mod_perl.h:27:22: note:
> expanded from macro 'MP_THREADED'
> #define MP_THREADED (defined(USE_ITHREADS) && APR_HAS_THREADS)
> ^
> In file included from modperl_apr_perlio.c:19:
> In file included from /usr/local/src/mod_perl-2.0.
> 10/src/modules/perl/mod_perl.h:89:
> /usr/local/src/mod_perl-2.0.10/src/modules/perl/modperl_global.h:29:5:
> warning: macro expansion producing 'defined' has undefined behavior
> [-Wexpansion-to-defined]
> #if MP_THREADED
> ^
> /usr/local/src/mod_perl-2.0.10/src/modules/perl/mod_perl.h:27:22: note:
> expanded from macro 'MP_THREADED'
> #define MP_THREADED (defined(USE_ITHREADS) && APR_HAS_THREADS)
> ^
> 2 warnings generated.
> make[3]: don't know how to make static. Stop
>
> *Before this theres a lot of warnings that say : *
> *=====================================*
>
> warning: macro expansion producing 'defined' has undefined behavior
> [-Wexpansion-to-defined]
>
> ==============
>
> Ive tried a bunch of things Ive found in google but cant get it to
> compile. I also tried going the APXS route ( which I don't like, but if
> thats the only option then Ill do it ). But that also fails to compile.
>
> ===============
>
> The FreeBSD port compiles, but It uses APXS, installs binaries and
> libraries all over the place, adds on a million apache modules, and has
> other issues.
>
> ================
>
> Any help will be very much appreciated, Ive been banging my head against
> the wall for a week with this.
>
>
> Thank you!
>


Randolf Richardson - randolf@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
In message <CAHpPzY5XW8JrPCdXETehPEjxhWRChgTpNxsdxQXHNumA=DkgQg@mail.gmail.com>
, jbiskofski writes:
>FreeBSD servers. Its been a few years since I've been able to compile
>mod-perl in FreeBSD. Everytime I need a new webserver I need to install
>FreeBSD9 and Perl 5.22. This has gradually been causing me more and more
>problems with server maintenance. Im hoping somebody can help me work this
>out. And ideally this can be resolved for other users, I've googled a bunch
>and it seems like Im not the only one going through this.
>
>*Heres what Im doing *
>*=================*
>
>tar xzfv perl-5.26.0.tar.gz
>cd perl-5.26.0
>sh Configure -Dusethreads -des -A ccflags=-fPIC -Dprefix=/usr/local/perl
>-Duseperlio
>make
>make test
>make install
>
>*This works and I get a working perl5.26 binary, which I then symlink to
>/usr/local/bin and /usr/bin*

I don't like mixing my application perl with my system perl,
but otherwise, LGTM.

>*===================*
>tar xzfv httpd-2.4.27.tar.bz2

$ ./configure --with-expat=/usr --with-ssl=/usr --enable-ssl \
--enable-proxy --enable-rewrite --enable-modules=all \
--enable-mods-shared=all --with-mpm=prefork \
--prefix=/usr/local/apache24

>tar xzfv mod_perl-2.0.10.tar.gz

$ env PATH=/usr/local/perl/bin:/usr/local/apache24/bin:${PATH} \
perl Makefile.PL MP_APXS=/usr/local/apache24/bin/apxs \
MAKE=make MP_NO_THREADS=1

make test fails for t/apache/read.t and t/filter/in_bbs_inject_header.t
but otherwise it works.

Happy hacking,
John
groenveld@acm.org
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
John, thanks for your reply. the MP_NO_THREADS=1 made a difference,
although Im still not able to complete the Build, ./configure works fine,
when I run make I get further along, but eventually I get this error :

2 warnings generated.
rm -f ../../../blib/arch/auto/APR/PerlIO/PerlIO.so
cc -shared -L/usr/local/lib -fstack-protector-strong PerlIO.o
modperl_apr_perlio.o -pthread -Wl,-E -fstack-protector-strong
-L/usr/local/lib -o ../../../blib/arch/auto/APR/PerlIO/PerlIO.so
chmod 755 ../../../blib/arch/auto/APR/PerlIO/PerlIO.so
make[3]: don't know how to make static. Stop

=======

I did build my perl with -Duseperlio, I dont know if that could be causing
the problem.

*Inspecting the FreeBSD port file I see that it needs gmake instead of
make, so I tried this :*

perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs MAKE=gmake
MP_NO_THREADS=1
gmake

*That also did not work, but the error was different :*

cp lib/ModPerl/PerlRunPrefork.pm ../blib/lib/ModPerl/PerlRunPrefork.pm
gmake[1]: Leaving directory
'/usr/local/src/mod_perl-2.0.10/ModPerl-Registry'
gmake[1]: Entering directory '/usr/local/src/mod_perl-2.0.10/WrapXS'
make[2]: don't know how to make w. Stop
make[2]: stopped in /usr/local/src/mod_perl-2.0.10/WrapXS/APR
gmake[1]: *** [Makefile:478: subdirs] Error 2
gmake[1]: Leaving directory '/usr/local/src/mod_perl-2.0.10/WrapXS'
gmake: *** [Makefile:627: subdirs] Error 2

=====

I appreciate the help.

- Jose

On Wed, Aug 30, 2017 at 3:23 PM, John D Groenveld <jdg117@elvis.arl.psu.edu>
wrote:

> In message <CAHpPzY5XW8JrPCdXETehPEjxhWRChgTpNxsdxQXHNumA=DkgQg@mail.
> gmail.com>
> , jbiskofski writes:
> >FreeBSD servers. Its been a few years since I've been able to compile
> >mod-perl in FreeBSD. Everytime I need a new webserver I need to install
> >FreeBSD9 and Perl 5.22. This has gradually been causing me more and more
> >problems with server maintenance. Im hoping somebody can help me work this
> >out. And ideally this can be resolved for other users, I've googled a
> bunch
> >and it seems like Im not the only one going through this.
> >
> >*Heres what Im doing *
> >*=================*
> >
> >tar xzfv perl-5.26.0.tar.gz
> >cd perl-5.26.0
> >sh Configure -Dusethreads -des -A ccflags=-fPIC -Dprefix=/usr/local/perl
> >-Duseperlio
> >make
> >make test
> >make install
> >
> >*This works and I get a working perl5.26 binary, which I then symlink to
> >/usr/local/bin and /usr/bin*
>
> I don't like mixing my application perl with my system perl,
> but otherwise, LGTM.
>
> >*===================*
> >tar xzfv httpd-2.4.27.tar.bz2
>
> $ ./configure --with-expat=/usr --with-ssl=/usr --enable-ssl \
> --enable-proxy --enable-rewrite --enable-modules=all \
> --enable-mods-shared=all --with-mpm=prefork \
> --prefix=/usr/local/apache24
>
> >tar xzfv mod_perl-2.0.10.tar.gz
>
> $ env PATH=/usr/local/perl/bin:/usr/local/apache24/bin:${PATH} \
> perl Makefile.PL MP_APXS=/usr/local/apache24/bin/apxs \
> MAKE=make MP_NO_THREADS=1
>
> make test fails for t/apache/read.t and t/filter/in_bbs_inject_header.t
> but otherwise it works.
>
> Happy hacking,
> John
> groenveld@acm.org
>
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
I tried recompiling perl without the -Duseperlio and got the same error.

On Wed, Aug 30, 2017 at 6:34 PM, jbiskofski <jbiskofski@gmail.com> wrote:

> John, thanks for your reply. the MP_NO_THREADS=1 made a difference,
> although Im still not able to complete the Build, ./configure works fine,
> when I run make I get further along, but eventually I get this error :
>
> 2 warnings generated.
> rm -f ../../../blib/arch/auto/APR/PerlIO/PerlIO.so
> cc -shared -L/usr/local/lib -fstack-protector-strong PerlIO.o
> modperl_apr_perlio.o -pthread -Wl,-E -fstack-protector-strong
> -L/usr/local/lib -o ../../../blib/arch/auto/APR/PerlIO/PerlIO.so
> chmod 755 ../../../blib/arch/auto/APR/PerlIO/PerlIO.so
> make[3]: don't know how to make static. Stop
>
> =======
>
> I did build my perl with -Duseperlio, I dont know if that could be
> causing the problem.
>
> *Inspecting the FreeBSD port file I see that it needs gmake instead of
> make, so I tried this :*
>
> perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs MAKE=gmake
> MP_NO_THREADS=1
> gmake
>
> *That also did not work, but the error was different :*
>
> cp lib/ModPerl/PerlRunPrefork.pm ../blib/lib/ModPerl/PerlRunPrefork.pm
> gmake[1]: Leaving directory '/usr/local/src/mod_perl-2.0.
> 10/ModPerl-Registry'
> gmake[1]: Entering directory '/usr/local/src/mod_perl-2.0.10/WrapXS'
> make[2]: don't know how to make w. Stop
> make[2]: stopped in /usr/local/src/mod_perl-2.0.10/WrapXS/APR
> gmake[1]: *** [Makefile:478: subdirs] Error 2
> gmake[1]: Leaving directory '/usr/local/src/mod_perl-2.0.10/WrapXS'
> gmake: *** [Makefile:627: subdirs] Error 2
>
> =====
>
> I appreciate the help.
>
> - Jose
>
> On Wed, Aug 30, 2017 at 3:23 PM, John D Groenveld <
> jdg117@elvis.arl.psu.edu> wrote:
>
>> In message <CAHpPzY5XW8JrPCdXETehPEjxhWRChgTpNxsdxQXHNumA=DkgQg@mail.gm
>> ail.com>
>> , jbiskofski writes:
>> >FreeBSD servers. Its been a few years since I've been able to compile
>> >mod-perl in FreeBSD. Everytime I need a new webserver I need to install
>> >FreeBSD9 and Perl 5.22. This has gradually been causing me more and more
>> >problems with server maintenance. Im hoping somebody can help me work
>> this
>> >out. And ideally this can be resolved for other users, I've googled a
>> bunch
>> >and it seems like Im not the only one going through this.
>> >
>> >*Heres what Im doing *
>> >*=================*
>> >
>> >tar xzfv perl-5.26.0.tar.gz
>> >cd perl-5.26.0
>> >sh Configure -Dusethreads -des -A ccflags=-fPIC -Dprefix=/usr/local/perl
>> >-Duseperlio
>> >make
>> >make test
>> >make install
>> >
>> >*This works and I get a working perl5.26 binary, which I then symlink to
>> >/usr/local/bin and /usr/bin*
>>
>> I don't like mixing my application perl with my system perl,
>> but otherwise, LGTM.
>>
>> >*===================*
>> >tar xzfv httpd-2.4.27.tar.bz2
>>
>> $ ./configure --with-expat=/usr --with-ssl=/usr --enable-ssl \
>> --enable-proxy --enable-rewrite --enable-modules=all \
>> --enable-mods-shared=all --with-mpm=prefork \
>> --prefix=/usr/local/apache24
>>
>> >tar xzfv mod_perl-2.0.10.tar.gz
>>
>> $ env PATH=/usr/local/perl/bin:/usr/local/apache24/bin:${PATH} \
>> perl Makefile.PL MP_APXS=/usr/local/apache24/bin/apxs \
>> MAKE=make MP_NO_THREADS=1
>>
>> make test fails for t/apache/read.t and t/filter/in_bbs_inject_header.t
>> but otherwise it works.
>>
>> Happy hacking,
>> John
>> groenveld@acm.org
>>
>
>
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
In message <CAHpPzY7f8bY3-SRgdqiuzHAKujPhm9OTTodqa5O8xszSA+UyEQ@mail.gmail.com>
, jbiskofski writes:
>*Inspecting the FreeBSD port file I see that it needs gmake instead of
>make, so I tried this :*
>
>perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs MAKE=gmake
>MP_NO_THREADS=1
>gmake
>
>*That also did not work, but the error was different :*

The quick fugly hack:
$ mkdir /tmp/bin
$ ln -s /usr/local/bin/gmake /tmp/bin
$ env PATH=/tmp/bin:/usr/local/perl-5.26.0/bin:/usr/local/apache/bin:${PATH} \
make test

John
groenveld@acm.org
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
Thanks John, unfortunately same result.

Even though I really want the newest Perl, I tried with 5.24 and 5.22 , but
still I always got the same result on 5.22, 5.24 and 5.26

gmake[1]: Leaving directory
'/usr/local/src/mod_perl-2.0.10/ModPerl-Registry'

gmake[1]: Entering directory '/usr/local/src/mod_perl-2.0.10/WrapXS'

make[2]: don't know how to make w. Stop

make[2]: stopped in /usr/local/src/mod_perl-2.0.10/WrapXS/APR

gmake[1]: *** [Makefile:477: subdirs] Error 2

gmake[1]: Leaving directory '/usr/local/src/mod_perl-2.0.10/WrapXS'

gmake: *** [Makefile:688: subdirs] Error 2

On Thu, Aug 31, 2017 at 6:17 AM, John D Groenveld <jdg117@elvis.arl.psu.edu>
wrote:

> In message <CAHpPzY7f8bY3-SRgdqiuzHAKujPhm9OTTodqa5O8xsz
> SA+UyEQ@mail.gmail.com>
> , jbiskofski writes:
> >*Inspecting the FreeBSD port file I see that it needs gmake instead of
> >make, so I tried this :*
> >
> >perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs MAKE=gmake
> >MP_NO_THREADS=1
> >gmake
> >
> >*That also did not work, but the error was different :*
>
> The quick fugly hack:
> $ mkdir /tmp/bin
> $ ln -s /usr/local/bin/gmake /tmp/bin
> $ env PATH=/tmp/bin:/usr/local/perl-5.26.0/bin:/usr/local/apache/bin:${PATH}
> \
> make test
>
> John
> groenveld@acm.org
>
Re: Trouble compiling modperl with FreeBSD11 [ In reply to ]
In message <CAHpPzY6VzLQcQLFLK68RdZHgtJE60aFyd=7CnNNdj0hn2Wh6aw@mail.gmail.com>
, jbiskofski writes:
>Thanks John, unfortunately same result.

$ ln -s /usr/local/bin/gmake /tmp/bin/make
$ env PATH=/tmp/bin:/usr/local/perl-5.26.0/bin:/usr/local/apache/bin:${PATH} \
make test

But it looks like you can avoid that fugliness:
$ env PATH=/usr/local/perl-5.26.0/bin:/usr/local/apache/bin:${PATH} \
MAKE=gmake \
perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs MAKE=gmake MP_NO_THREADS=1

John
groenveld@acm.org