From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marcin Kasperski Newsgroups: gmane.os.tru64.managers Subject: Anyone managed to compile mod_perl as DSO (or have any hints?) Date: Mon, 02 Dec 2002 16:27:16 +0100 Organization: Softax Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <20021202162716.15b9f474.Marcin.Kasperski@softax.com.pl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1038842752 10883 80.91.224.249 (2 Dec 2002 15:25:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 2 Dec 2002 15:25:52 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18IsS4-0002o2-00 for ; Mon, 02 Dec 2002 16:25:41 +0100 Original-Received: (qmail 2145 invoked by uid 5); 2 Dec 2002 15:27:47 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 2136 invoked by uid 49493); 2 Dec 2002 15:27:47 -0000 Original-Received: from Marcin.Kasperski@softax.com.pl by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.51. spamassassin: 2.50-cvs. Clear:SA:0(-4.4/5.0):. Processed in 0.632598 secs); 02 Dec 2002 15:27:47 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 2 Dec 2002 15:27:46 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H6I0025O0A0OP@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 02 Dec 2002 10:27:46 -0500 (EST) Original-Received: from bozon.softax.com.pl (bozon.softax.pl [62.89.75.130]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTPS id <0H6I00ECL09IK7@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 02 Dec 2002 10:27:22 -0500 (EST) Original-Received: from euler (atlas.softax.pl [62.89.75.141]) by bozon.softax.com.pl (Postfix) with SMTP id 0B0E5FF for ; Mon, 02 Dec 2002 16:27:17 +0100 (CET) Original-To: tru64-unix-managers@ornl.gov X-Mailer: Sylpheed version 0.7.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) Xref: main.gmane.org gmane.os.tru64.managers:2607 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2607 I've spent two days trying to get working mod_perl compiled as DSO on Tru64 and still can't succeed. Below I describe what I tried, in case anyone could suggest something I would be really grateful. I describe also why such configuration is important for me, in case someone can suggest alternative solution, I would appreciate it too. Sideways, I describe minor makefile error which is probably independent from the whole problem. *] Background I have developed some (fairly large) mod_perl application. The application works perfectly on Tru64 with mod_perl statically linked with apache (and all other modules as DSO's). It also works perfectly with fully DSO (with mod_perl.so too) configuration on Debian Gnu Linux. I would like to get it working with DSO mod_perl on Tru64 for single reason: in DSO configuration I can use 'apachectl graceful' to load the new application version in the matter completely invisible for the clients (no broken requests, no short period of inavailability). In my case it would be very demanded feature. At the same time, with statically linked mod_perl I must use 'apachectl stop; wait a moment; apachectl start' to load the new version. It can matter (or not) that my application uses some custom module implemented in C++ (compiled with Compaq C++ for Tru64) and referencing 3rd party libraries (interface to some middleware, I'll not delve into details now but in case you thing they are important let me know). It could be worth noting that no library mentioned here links with thread library (so this is not the source of the problem). *] My attempts In short: I tried different compilation methods with two possible outcomes: a) apache and modperl compile succesfully but I get coredump while the application is starting (in all cases SEGVs, in some cases core's confused the debugger, in other I managed to notice __at_fork in backtrace) b) everything seem to compile succesfully but I get dlopen: /tools/apache/libexec/mod_perl.so: symbol "PL_perl_destruct_level" unresolved while the application is starting As far as I could checked there were no mistakes like 'using one perl to compile and the other one to run', I always built everything from scratch and then tested. Below I describe different variants of compilation of perl and apache, I tried most of the 'perl this way, apache that way' combinations. 1) Perl compilation (I use 5.6.1) I used commands like the one below sh Configure -des -Dprefix=/tools/perl -Uinstallusrbinperl \ -Uuseshrplib -Uusemymalloc -Ubincompat5005 make make test make install and also tried all possible combinations of useshrplib and usemymalloc In all cases perl itself compiled, linked and tested correctly, also my custom modules compiled and worked) 2) apache (I use 1.3.27) & modperl (I use 1.27) I tried different combinations described below. It is worth noting, that whatever method I choosen there was minor error if I used -Duseshrplib while building perl: while linking modperl (libperl.so) I got the following error: ld -shared -expect_unresolved "*" -O4 -msym -std -s -L/usr/local/lib -o libperl.so mod_perl.lo perlxsi.lo perl_config.lo perl_util.lo perlio.lo mod_perl_opmask.lo Apache.lo Constants.lo ModuleConfig.lo Log.lo URI.lo Util.lo Connection.lo Server.lo File.lo Table.lo -Wl,-rpath,/tools/perl/lib/5.6.1/alpha-dec_osf/CORE -L/usr/local/lib /tools/perl/lib/5.6.1/alpha-dec_osf/auto/DynaLoader/DynaLoader.a -L/tools/perl/lib/5.6.1/alpha-dec_osf/CORE -lperl -lm -liconv -lutil ld: Invalid flag usage: Wl,-rpath,/tools/perl/lib/5.6.1/alpha-dec_osf/CORE, -Wx,-o ption must appear after -_SYSTYPE_SVR4 ld: Usage: ld [options] file [...] Simple change in the Makefile - replacing ld with cc - caused this command to succeed. So in all the cases when I got this error I patched the problem this way and proceeded. So here is what I tried a) Simultaneous compilation cd mod_perl-1.27 perl Makefile.PL $PERL_MOD_DBG $PLTRACE \ APACHE_SRC=../apache_1.3.27/src \ APACHE_PREFIX=/tools/apache \ USE_APACI=1 \ USE_DSO=1 \ DO_HTTPD=1 \ ALL_HOOKS=1 \ EVERYTHING=1 \ APACI_ARGS="--enable-module=so,\ --prefix=/tools/apache,\ --enable-rule=SHARED_CHAIN,\ --enable-module=access,--enable-shared=access,\ --enable-module=actions,--enable-shared=actions,\ --enable-module=alias,--enable-shared=alias,\ --enable-module=asis,--enable-shared=asis,\ --enable-module=auth,--enable-shared=auth,\ --enable-module=auth_anon,--enable-shared=auth_anon,\ --enable-module=auth_db,--enable-shared=auth_db,\ --enable-module=auth_dbm,--enable-shared=auth_dbm,\ --enable-module=autoindex,--enable-shared=autoindex,\ --enable-module=cern_meta,--enable-shared=cern_meta,\ --enable-module=cgi,--enable-shared=cgi,\ --enable-module=digest,--enable-shared=digest,\ --enable-module=dir,--enable-shared=dir,\ --enable-module=env,--enable-shared=env,\ --enable-module=example,--enable-shared=example,\ --enable-module=expires,--enable-shared=expires,\ --enable-module=headers,--enable-shared=headers,\ --enable-module=imap,--enable-shared=imap,\ --enable-module=include,--enable-shared=include,\ --enable-module=info,--enable-shared=info,\ --enable-module=log_agent,--enable-shared=log_agent,\ --enable-module=log_config,--enable-shared=log_config,\ --enable-module=log_referer,--enable-shared=log_referer,\ --enable-module=mime,--enable-shared=mime,\ --enable-module=mime_magic,--enable-shared=mime_magic,\ --enable-module=mmap_static,--enable-shared=mmap_static,\ --enable-module=negotiation,--enable-shared=negotiation,\ --enable-module=proxy,--enable-shared=proxy,\ --enable-module=rewrite,--enable-shared=rewrite,\ --enable-module=setenvif,--enable-shared=setenvif,\ --enable-module=speling,--enable-shared=speling,\ --enable-module=status,--enable-shared=status,\ --enable-module=unique_id,--enable-shared=unique_id,\ --enable-module=userdir,--enable-shared=userdir,\ --enable-module=usertrack,--enable-shared=usertrack,\ --enable-module=vhost_alias,--enable-shared=vhost_alias,\ " make make install I also tried without SHARED_CHAIN and with additional --enable-rule=SHARED_CORE. b) I also tried apxs variant: cd apache-1.3.27 ./configure --enable-module=so \ --prefix=/tools/apache \ --enable-rule=SHARED_CHAIN \ --enable-module=access --enable-shared=access \ --enable-module=actions --enable-shared=actions \ --enable-module=alias --enable-shared=alias \ --enable-module=asis --enable-shared=asis \ --enable-module=auth --enable-shared=auth \ --enable-module=auth_anon --enable-shared=auth_anon \ --enable-module=auth_db --enable-shared=auth_db \ --enable-module=auth_dbm --enable-shared=auth_dbm \ --enable-module=autoindex --enable-shared=autoindex \ --enable-module=cern_meta --enable-shared=cern_meta \ --enable-module=cgi --enable-shared=cgi \ --enable-module=digest --enable-shared=digest \ --enable-module=dir --enable-shared=dir \ --enable-module=env --enable-shared=env \ --enable-module=example --enable-shared=example \ --enable-module=expires --enable-shared=expires \ --enable-module=headers --enable-shared=headers \ --enable-module=imap --enable-shared=imap \ --enable-module=include --enable-shared=include \ --enable-module=info --enable-shared=info \ --enable-module=log_agent --enable-shared=log_agent \ --enable-module=log_config --enable-shared=log_config \ --enable-module=log_referer --enable-shared=log_referer \ --enable-module=mime --enable-shared=mime \ --enable-module=mime_magic --enable-shared=mime_magic \ --enable-module=mmap_static --enable-shared=mmap_static \ --enable-module=negotiation --enable-shared=negotiation \ --enable-module=proxy --enable-shared=proxy \ --enable-module=rewrite --enable-shared=rewrite \ --enable-module=setenvif --enable-shared=setenvif \ --enable-module=speling --enable-shared=speling \ --enable-module=status --enable-shared=status \ --enable-module=unique_id --enable-shared=unique_id \ --enable-module=userdir --enable-shared=userdir \ --enable-module=usertrack --enable-shared=usertrack \ --enable-module=vhost_alias --enable-shared=vhost_alias make make test make install cd mod_perl-1.27 perl Makefile.PL USE_APXS=1 WITH_APXS=/tools/apache/bin/apxs \ EVERYTHING=1 make make install Is there anything I could try? Have anyone succeeded in getting such configuration working?