hurstdog has asked for the wisdom of the Perl Monks concerning the following question:

I've been trying to install mod_perl this morning with no luck. It works fine when I just install mod_perl 1.26, apache 1.3.20, and php-4.0.4pl1, but when I add in the mod_ssl-2.8.4-1.3.20 it fails with a

/usr/local/lib/perl5/5.6.1/i386-freebsd/auto/DynaLoader/DynaLoader.a(D +ynaLoader.o): In function `SaveError': DynaLoader.o(.text+0x159): undefined reference to `Perl_vmess'" error.

Any ideas what the problem could be? Someone told me it might be the way I have perl installed, that I have it statically linked. I'm *this* close to reinstalling perl 5.6.1 for dynamic linking/loading, but I'd much prefer to not do that. Hopefully one of the monks can help. Any ideas?

Oh yeah, this is on FreeBSD-4.3-release (soon to be stable) and here's the output of perl -V:

hurstdog@feynman src$ perl -V Summary of my perl5 (revision 5.0 version 6 subversion 1) configuratio +n: Platform: osname=freebsd, osvers=4.3-release, archname=i386-freebsd uname='freebsd feynman.hurstdog.org 4.3-release freebsd 4.3-releas +e #0: sat apr 21 10:54:49 gmt 2001 jkh@narf.osd.bsdi.com:usrsrcsyscompilegeneric + i386 ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=unde f useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include', optimize='-O', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.3 [FreeBSD] 20010315 (release)', gc +cosandvers ='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize =8 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-E -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lm -lc -lcrypt -lutil perllibs=-lm -lc -lcrypt -lutil libc=, so=so, useshrplib=false, libperl=libperl.a 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 Built under freebsd Compiled at Jun 13 2001 10:29:52 @INC: /usr/local/lib/perl5/5.6.1/i386-freebsd /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl .

Replies are listed 'Best First'.
Re: mod_perl install troubles
by Zucan (Beadle) on Aug 14, 2001 at 04:04 UTC
    There are a couple issues that might affect your installation. First, you might want to compile your Apache server statically, as in, no dynamically loadable modules. This usually fixes the problems when compiling SSL into the mix with the other modules. This means not configuring apache with --enable-shared on the command line.

    Secondly, Perl could very well be the problem, but not necessarily for the reason you think. Your friend suggested that Perl might be compiled statically. The term "static" can be confusing, and I believe what he meant was that Perl should be compiled so that perl modules can be dynamically loaded into it at run-time. Running "ldd" on the Perl binary won't provide useful information, since it is possible to have perl compiled to not dynamically load perl modules, but still be compiled dynamically itself. In any the case, I don't believe this is how your Perl is compiled, especially one that comes with FreeBSD!

    Finally, when I have had problems with mod_perl when it is compiled into Apache with PHP and ApacheSSL (not mod_ssl), the problem was that Perl came with the OS, and was compiled using a different C compiler, different location for C libraries etc. Perl remembers all this information and uses it when you are building new modules that will get installed into Perl. I see above that gcc 2.95.3 was used (though, it was called 'cc'). Check the version of your compiler and location of its libs to see if that is the problem.

    In the end, the solution will probably be the same. You need to recompile Perl. This means that the settings that will get saved into the Perl core (which is what you listed above) will reflect your system libraries, compiler etc, which will be used to build various things, like mod_perl.

    Incidentally, you won't always run into the above problem... but mod_perl is a gigantic module, and does seem to trigger the problem.

    Good luck!
    Zucan

Re: mod_perl install troubles
by mugwumpjism (Hermit) on Aug 14, 2001 at 03:39 UTC

    Nasty. You can find out how perl is linked without decyphering the CC flags with ldd:

    $sam@fractal:~$ ldd `which perl` libdl.so.2 => /lib/libdl.so.2 (0x40020000) libm.so.6 => /lib/libm.so.6 (0x40023000) libc.so.6 => /lib/libc.so.6 (0x40045000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x40164000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) sam@fractal:~$

    ldd shows you which libraries will be linked in to your perl on execution; if there are any there at all, your perl is dynamically linked.

    Hope this helps!