Re: mod_perl.c:61: `my_perl' undeclared under Cygwin

[prev] [thread] [next] [Date index for 2005/01/05]

From: Nick ***
Subject: Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
Date: 22:28 on 05 Jan 2005
>>>> > /usr/src/mp2/xs/APR/Base64/APR__Base64.h: In function 
>>>> > `MPXS_apr_base64_encode': 
>>>> > /usr/src/mp2/xs/APR/Base64/APR__Base64.h:37: static 
>>>> > symbol `MPXS_apr_base64_enco de' is marked dllexport 
>>> 
>>>> Sorry, but I've never seen this kind of errors before. Any 
>>>> chance you can find someone who groks cygwin 
>>>> compiler/linker so they can help to resolve those? 
>>> 
>>>I'm not that familiar with cygwin, but if it means the 
>>>same as with VC++, I think the problem is that the 
>>>symbol is supposed to be static, but is marked with 
>>>dllexport, meaning it will appear in a dll (shared 
>>>library). Does the following patch change anything? 
>>> 
>>>[...]

>>No, I get the same error :( 

>I have upgraded my version of cygwin from 1.3.xx to 1.5.12. 
>Now when I run make I get a liitle bit different error:
>[...]


I've found the source of all evil with some googling and searching the archives! :)))
About the dllexport thing - it seems this is a bug in cygwin's gcc version.
I'll wait for the next binary release (3.3.3 or 3.4.3), because I can't build 3.4.3 from source - I get some errors.

About the undefined symbols when linking mod_perl.so - as Stas said, these symbols should be resolved at runtime,
but as much as I understand (by googling), windows doesn't allow this. These sybbols should be defined/resolved (don't know what's
the difference) at linking time. The good news is that under cygwin you can link very easily to an already compiled .dll file.
And the one that we need is called libhttpd.dll. What's the bad news? Apache 1.xx had this configure option: --enable-rule=SHARED_CORE,
which builds the server and libhttpd.dll, which contains the whole core.
I don't know if this option is still valid for Apache 2.xx. Does anyone know? I can't test it, because when I execute
./configure --enable-rule=SHARED_CORE or ./configure --enable-so or anything other than --prefix=/path
I get some errors not related to an invalid 'enable-rule=SHARED_CORE' option. Maybe it's a bug in apache's configure script.
I've written to apache's mailing list about this problem.

Anyway, if you are sure that enable-rule=SHARED_CORE is available for apache 2.x and does the same as for apache 1.x, 
I suggest that when configuring mp2 under cygwin, the process tests whether apache was compiled with --enable-rule=SHARED_CORE
and if not - suggest to the user to compile the server with this option and then die.

When linking mod_perl.so the current command is this:

ld2 -L/usr/local/lib \ 
\ 
mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo modperl_config.lo 
[...]
l5/5.8.5/cygwin/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.5/cygwin 
/CORE -lperl -lcrypt -lgdbm_compat \ 
-o mod_perl.so 
gcc -shared -o mod_perl.dll -Wl,--out-implib=libmod_perl.dll.a -Wl,--export-all 
-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 \ 
-L/usr/local/lib mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo 
[...]
ves.lo modperl_flags.lo modperl_xsinit.lo modperl_exports.lo -L/usr/local/lib /u 
sr/local/lib/perl5/5.8.5/cygwin/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/pe 
rl5/5.8.5/cygwin/CORE -lperl -lcrypt -lgdbm_compat


The new command should look like this:
ld2 -L/usr/local/lib \ 
\ 
mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo modperl_config.lo 
[...]
l5/5.8.5/cygwin/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.5/cygwin 
/CORE -lperl -lcrypt -lgdbm_compat \ 
-o mod_perl.so 
gcc -shared -o mod_perl.dll -Wl,--out-implib=libmod_perl.dll.a -Wl,--export-all 
-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 \ 
-L/usr/local/lib mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo 
[...]
ves.lo modperl_flags.lo modperl_xsinit.lo modperl_exports.lo -L/usr/local/lib /u 
sr/local/lib/perl5/5.8.5/cygwin/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/pe 
rl5/5.8.5/cygwin/CORE -lperl -lcrypt -lgdbm_compat /home/admin/httpd/bin/libhttpd.dll



Note the last line and /home/admin/httpd/bin/libhttpd.dll. I believe the actual path to libhttpd.dll can be found in apxs.
Note: All this is based on my experience with the MP1 install process. MP1 suffers the same problem under cygwin and
with the above actions I manage to install it and run it successfuly.


P.S. I'm sorry I can not supply patches and help more with this issue. That's all I can do for now.

-----------------------------------------------------------------
Активирайте SMS известяване за получено писмо - http://promo.abv.bg/new_sms.html

mod_perl.c:61: `my_perl' undeclared under Cygwin
sdfgsd sergserg 11:44 on 13 Dec 2004

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
sdfgsd sergserg 15:00 on 13 Dec 2004

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
sdfgsd sergserg 17:32 on 14 Dec 2004

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
Nick *** 22:28 on 05 Jan 2005

Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
Philippe M. Chiasson 04:31 on 31 Jan 2005

Generated at 14:43 on 11 Apr 2005 by mariachi v0.52