Oh.. I forgot another thing : you'll have to link with cpprt0_stub.o also .. It does some C++ initialization work for C programs to be able toload C++ modules.
*********************************************************** $ cat cpprt0_stub.s .code ; stubs for static constructors in a.out .export __StaticCtorTable_Start,data .export __StaticCtorTable_End,data __StaticCtorTable_Start __StaticCtorTable_End .data ; stubs for static constructors in a.out, compiled with +z/+Z .export __ZStaticCtorTable_Start,data .export __ZStaticCtorTable_End,data __ZStaticCtorTable_Start __ZStaticCtorTable_End *********************************************************** (the cpprt0_stub.s should be compiled with the PIC option).. -Madhu >-----Original Message----- >From: MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) >[mailto:[EMAIL PROTECTED] >Sent: Thursday, January 30, 2003 10:50 AM >To: 'William A. Rowe, Jr.'; dev@apr.apache.org; dev@httpd.apache.org >Cc: Arliss, Noah; [EMAIL PROTECTED] >Subject: RE: [PATCH] HPUX static's and Mixing C with C++ modules > > >Hi, > +1 for the patch. > >We've been using BIND_VERBOSE in our code, and has not created >a problem >till now. The shl_load looks like : > dso.c:122:shl_t os_handle = shl_load(path, >BIND_IMMEDIATE|BIND_VERBOSE, >0L); > >Here are my notes for building apache when using C++ modules : >1. Use shl_load instead of dlopen - because dlopen has some problems >unwinding problem C++ library. >2. How to get C++ modules to work with Apache (on hp-ux): > >On PA : >Case 1 : dlopen is used >- Link httpd with "-lcl -lCsup" to prevent the unwinding problem > How does link with libCsup solve this problem? > libCsup is the library that can't be unloaded. But, if you link with >libCsup, you may break customers who use the -AA libCsup_v2. > >Case 2 : shl_load is used (recommended solution) >- Link httpd with "-lcl". >- Force the use of shl_load during configure (the way we do is >by creating a >config.cache file, and feed it to configure). > >On IA : >- Link httpd with "-lcl -lunwind" should resolve the problem >(even if you >use dlopen) > >Further, of late, we've been experiencing some problems with >the default >loader on HP-UX (PA).. The recommendation is to use the latest >LD version >(B.11.32) available (Patch PHSS_26559/PHSS_26560). > >Hope this helps, >-Madhu > > >>-----Original Message----- >>From: William A. Rowe, Jr. [mailto:[EMAIL PROTECTED] >>Sent: Thursday, January 30, 2003 8:32 AM >>To: dev@apr.apache.org; dev@httpd.apache.org >>Cc: Arliss, Noah; [EMAIL PROTECTED] >>Subject: [PATCH] HPUX static's and Mixing C with C++ modules >> >> >>Of course I'm really happy to *finally* get some feedback on >that issue >>(since we have few HPUX participants here, my pleas for comments went >>mostly unanswered.) >> >>The small bit below deserves *instant* reaction; since it can >>be done with >>very little extra logic. It seems other issues with HPUX >>shl_load() were >>identified earlier by Alexis and Joe (Joe follows this list so >>I didn't explicitly >>cc him above) ... for the resolution of BIND_VERBOSE read; >> >>http://www.contactor.se/~dast/svn/archive-2002-12/0474.shtml >> >>I'm hoping they can provide extra feedback on this patch. >[And, by the >>way, I'm concerned that patch lost some useful diagnostics info >>- perhaps we should reenable BIND_VERBOSE for --maintainer-mode?] >>Anyways... >> >>An example thread of someone struggling here; >> >>http://h21007.www2.hp.com/cxx-dev/CXX/cxx-dev.0203/0071.html >> >>So... I'd ask you all to check out this patch (which seems >>very reasonable) >>and let me know if you encounter any issues. >> >>And Arliss... please give us some citations or reconciliation >>between the >>two comments below (they seem contradictary); >> >>At 09:43 AM 1/30/2003, Arliss, Noah wrote: >>>3) shl_load does not like static initialization (even with >>BIND_NOSTART >>>removed from the shl_load call). >>> >>>It would be great if one or more of the following changes >>could be made >>>(mostly from Bill's attached mail): >>> >>> 4) Remove BIND_NOSTART from the bits set when calling >>shl_load since >>>that explicitly stops any static >>> initialization. It would be great if I could get >>this one into >>>both apache 1.3 and 2.0. >> >>Note that this code has existed since rev 1.7 of >>apache-1.3/src/os/unix/os.c >>and has never been touched since it was introduced... >> >>Revision ><http://cvs.apache.org/viewcvs.cgi/*checkout*/apache-1.3/src/os /unix/os.c?re v=1.7>1.7 / <http://cvs.apache.org/viewcvs/apache-1.3/src/os/unix/os.c?rev=1.7&content-t ype=text/vnd.viewcvs-markup>(view) - <http://cvs.apache.org/viewcvs/apache-1.3/src/os/unix/os.c?annotate=1.7>anno tate - <http://cvs.apache.org/viewcvs/apache-1.3/src/os/unix/os.c?r1=1.7>[select for diffs] , Sun Apr 12 15:49:28 1998 UTC (4 years, 9 months ago) by rse Branch: <http://cvs.apache.org/viewcvs/apache-1.3/src/os/unix/os.c?only_with_tag=MAI N>MAIN Changes since 1.6: +43 -0 lines Diff to <http://cvs.apache.org/viewcvs/apache-1.3/src/os/unix/os.c.diff?r1=1.6&r2=1. 7>previous 1.6 (<http://cvs.apache.org/viewcvs/apache-1.3/src/os/unix/os.c.diff?r1=1.6&r2=1 .7&diff_format=h>colored) Although I though we have no chance under HP/UX for using shared objects I today figured out that their proprietary shl_xxx system calls are very close to the dlopen-style interface. And because our os/unix/ stuff already provides an abstraction layer we now can provide DSO support for HP/UX by emulating the dlopen-style interface while not changing anything inside mod_so ;-) So I think we are safe adopting these changes. The fact that this code was only modified once (the VERBOSE change) shows that the entire logic could stand a good vetting. The next question to answer (after these patches are applied) is who's job is it to call _main()? I presume that would be the module author's - if they desired it. But I'm looking for additional feedback and thoughts. Bill