On 6/4/2012 7:46 AM, Jan Kaluža wrote:
On 05/09/2012 09:40 AM, Jan Kaluža wrote:
Right, those patches only hardcodes it for httpd-2.4. The next step
should be to probably put #ifdefs around remote_ip. Other things should
be done by source_scan script I believe.


I've splitted the patch into separate patches. This is against mod_perl-2.0.6. With those patches, mod_perl compiles against httpd-2.2 and also against httpd-2.4. It's based on the Stefan's work.

http://jkaluza.fedorapeople.org/mod_perl/
I can't repeat your success because I can't compile against 2.4.

Specifically, Compiling against Apache 2.4.1 from source, I've tried the mod_perl 2.0.6 release with these patches on a CentOS 6.2 x64 system with a little bit of trouble.

Your patches apply cleanly but I throw this error trying to make based on the following config command: perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs MP_APR_CONFIG=/usr/local/apache2/bin/apr-1-config

modperl_constants.c: In function 'modperl_constants_lookup_apache2_const':
modperl_constants.c:809: error: 'OPT_INCNOEXEC' undeclared (first use in this function) modperl_constants.c:809: error: (Each undeclared identifier is reported only once
modperl_constants.c:809: error: for each function it appears in.)
make[1]: *** [modperl_constants.lo] Error 1
make[1]: Leaving directory `/usr/src/mod_perl-2.0.6/src/modules/perl'
make: *** [modperl_lib] Error 2

Looking at ./src/modules/perl/modperl_constants.c has two references to OPT_INCNOEXEC.

This comes from ./xs/tables/current/Apache2/ConstantsTable.pm referring to OPT_INCNOEXEC. If I remove that entry I get a lot further until I get to this error:

Connection.xs: In function 'XS_Apache2__Connection_remote_addr':
Connection.xs:117: error: 'conn_rec' has no member named 'remote_addr'
Connection.xs: In function 'XS_Apache2__Connection_remote_ip':
Connection.xs:134: error: 'conn_rec' has no member named 'remote_ip'
Connection.xs:138: error: 'conn_rec' has no member named 'remote_ip'
make[3]: *** [Connection.o] Error 1
make[3]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS/Apache2/Connection'
make[2]: *** [subdirs] Error 2
make[2]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS/Apache2'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS'
make: *** [subdirs] Error 2

To fix those, I edited apache2_structures.map & StructureTable.pm to change remote_addr and remote_ip to client_addr and client_ip

That got me to:

ServerRec.xs: In function 'XS_Apache2__ServerRec_loglevel':
ServerRec.xs:160: error: 'server_rec' has no member named 'loglevel'
ServerRec.xs:164: error: 'server_rec' has no member named 'loglevel'
make[3]: *** [ServerRec.o] Error 1
make[3]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS/Apache2/ServerRec'
make[2]: *** [subdirs] Error 2
make[2]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS/Apache2'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/usr/src/mod_perl-2.0.6/WrapXS'
make: *** [subdirs] Error 2

To fix that, I changed the /xs/tables/current/Apache2/StructureTable.pm to point to log.level instead of loglevel.

That got me compiled. A make test fails pretty badly though so not sure what state tests are in.

[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /usr/src/mod_perl-2.0.6/t/TEST -bugreport -verbose=0 /usr/local/apache2/bin/httpd -d /usr/src/mod_perl-2.0.6/t -f /usr/src/mod_perl-2.0.6/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.4.1 (event MPM)

waiting 300 seconds for server to start: .[Mon Jun 04 20:00:02.886169 2012] [env:warn] [pid 2704:tid 139952181413632] AH01506: PassEnv variable LD_LIBRARY_PATH was undefined
[  error] oh crap, server dumped core
[ error] for stacktrace, run: gdb /usr/local/apache2/bin/httpd -core /usr/src/mod_perl-2.0.6/core.2704
[  error]
server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)
[  error] oh jeez, server dumped core
[ error] for stacktrace, run: gdb /usr/local/apache2/bin/httpd -core /usr/src/mod_perl-2.0.6/core.2704 sh: line 1: 2599 Terminated /usr/bin/perl /usr/src/mod_perl-2.0.6/t/TEST -bugreport -verbose=0
make: *** [run_tests] Error 143

Patch with the extra changes I needed are attached. Perhaps it can help. If someone can give me direction I can perform more testing, etc.

regards,
KAM
diff -ruN mod_perl-2.0.6/xs/maps/apache2_structures.map 
mod_perl-2.0.6-KAM/xs/maps/apache2_structures.map
--- mod_perl-2.0.6/xs/maps/apache2_structures.map       2011-02-07 
21:00:11.000000000 -0500
+++ mod_perl-2.0.6-KAM/xs/maps/apache2_structures.map   2012-06-04 
20:06:14.513434627 -0400
@@ -106,8 +106,8 @@
 <  local_addr
 <  local_ip
 <  local_host
-<  remote_addr
-   remote_ip
+<  client_addr
+   client_ip
 <  remote_host
 -  remote_logname
 <  aborted
diff -ruN mod_perl-2.0.6/xs/tables/current/Apache2/ConstantsTable.pm 
mod_perl-2.0.6-KAM/xs/tables/current/Apache2/ConstantsTable.pm
--- mod_perl-2.0.6/xs/tables/current/Apache2/ConstantsTable.pm  2011-02-07 
21:00:11.000000000 -0500
+++ mod_perl-2.0.6-KAM/xs/tables/current/Apache2/ConstantsTable.pm      
2012-06-04 19:43:09.771712070 -0400
@@ -52,7 +52,6 @@
       'OPT_SYM_LINKS',
       'OPT_EXECCGI',
       'OPT_UNSET',
-      'OPT_INCNOEXEC',
       'OPT_SYM_OWNER',
       'OPT_MULTI',
       'OPT_ALL'
diff -ruN mod_perl-2.0.6/xs/tables/current/Apache2/StructureTable.pm 
mod_perl-2.0.6-KAM/xs/tables/current/Apache2/StructureTable.pm
--- mod_perl-2.0.6/xs/tables/current/Apache2/StructureTable.pm  2011-02-07 
21:00:11.000000000 -0500
+++ mod_perl-2.0.6-KAM/xs/tables/current/Apache2/StructureTable.pm      
2012-06-04 20:03:43.254712273 -0400
@@ -2708,11 +2708,11 @@
       },
       {
         'type' => 'apr_sockaddr_t *',
-        'name' => 'remote_addr'
+        'name' => 'client_addr'
       },
       {
         'type' => 'char *',
-        'name' => 'remote_ip'
+        'name' => 'client_ip'
       },
       {
         'type' => 'char *',
@@ -3245,7 +3245,7 @@
       },
       {
         'type' => 'int',
-        'name' => 'loglevel'
+        'name' => 'log.level'
       },
       {
         'type' => 'int',

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org

Reply via email to