apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)" <madhusudan_mathiha...@hp.com>
Subject RE: [PATCH] HPUX static's and Mixing C with C++ modules
Date Thu, 30 Jan 2003 19:39:44 GMT
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 
; stubs for static constructors in a.out
        .export __StaticCtorTable_Start,data
        .export __StaticCtorTable_End,data

; stubs for static constructors in a.out, compiled with +z/+Z
        .export __ZStaticCtorTable_Start,data
        .export __ZStaticCtorTable_End,data

(the cpprt0_stub.s should be compiled with the PIC option)..


>-----Original Message-----
>Sent: Thursday, January 30, 2003 10:50 AM
>To: 'William A. Rowe, Jr.'; dev@apr.apache.org; dev@httpd.apache.org
>Cc: Arliss, Noah; ahuxley@gmx.net
>Subject: RE: [PATCH] HPUX static's and Mixing C with C++ modules
>	+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, 
>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,
>>-----Original Message-----
>>From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net]
>>Sent: Thursday, January 30, 2003 8:32 AM
>>To: dev@apr.apache.org; dev@httpd.apache.org
>>Cc: Arliss, Noah; ahuxley@gmx.net
>>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;
>>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?]
>>An example thread of someone struggling here;
>>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 
>>>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 
>>and has never been touched since it was introduced...
v=1.7>1.7 /
ype=text/vnd.viewcvs-markup>(view) -
tate -
for diffs] , Sun Apr 12 15:49:28 1998 UTC (4 years, 9 months ago) by rse 
Changes since 1.6: +43 -0 lines 
Diff to
7>previous 1.6

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
an abstraction layer we now can provide DSO support for HP/UX by emulating
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.


View raw message