Hi,

I tried rebuilding mod_perl 2.0.7 after upgrading various things, and got the 
following error message when trying to start Apache:

httpd: Syntax error on line 60 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/modules/mod_perl.so into server:
    dlopen(/usr/local/apache/modules/mod_perl.so, 10):
    Symbol not found: _modperl_handler_name
    Referenced from: /usr/local/apache/modules/mod_perl.so
    Expected in: dynamic lookup

After some spelunking I found a fix: make sure the MP_INLINE isn't defined as 
__inline__

#define MP_INLINE

but not really the root cause.

First, my environment:

MacOSX 10.8.2
Xcode 4.5.2 with command-line tools (I suspect the culprit may be here, but I 
don't really know what I'm talking about)
Apache 2.2.23
Perl 5.16.2
mod_perl 2.0.7
apr 1.4.6

I had previously built mod_perl 2.0.7 with perl 5.16.1, Apache 2.2.22 on MacOSX 
10.7.5 (and previous version of Xcode), without seeing this problem.

Here are my notes.

Given the moan about not finding modperl_handler_name, I look in mod_perl.so:

    % nm mod_perl.so | grep --context=2 modperl_handler_name
    00000000000053b0 T _modperl_handler_lookup_handlers
    0000000000005190 T _modperl_handler_make_args
                     U _modperl_handler_name
    0000000000004eb0 T _modperl_handler_new
    00000000000056c0 T _modperl_handler_new_from_sv

Indeed, not defined. So I go and look at modperl_handler.c

    MP_INLINE
    const char *modperl_handler_name(modperl_handler_t *handler)
    {
        ...
    }

So, wonder what MP_INLINE is defined as, and in modperl_common_util.h I find:

    #ifdef MP_DEBUG
    #define MP_INLINE
    #else
    #define MP_INLINE APR_INLINE
    #endif

Running the pre-processor stage only, I see the definition ends up as:

    __inline__
    const char *modperl_handler_name(modperl_handler_t *handler)

So I just forced MP_INLINE to be defined blank, which made everything work 
cleanly.

Can anyone tell me what the real problem and fix are?

Cheers,
Neil

Reply via email to