httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: Solution for weird DSO issues
Date Thu, 22 Jul 1999 06:51:42 GMT

In article <Pine.WNT.4.10.9907191031520.77-100000@rasmus.raleigh.ibm.com> you wrote:

> We put a workaround into PHP a while ago which wrapped fclose in a static
> function and we would pass that pointer instead.  And that solved it.  
> But after discussing the issue with H.J. Lu and getting some background on
> these IO_new_fclose and IO_old_fclose calls that were put in for backwards
> compatibility reasons he pointed out that we really should not be building
> shared libs using ld -Bshareable.  We should be using gcc -shared.  And
> sure enough, building the PHP DSO using gcc -shared solved the problems.
> 
> The direct quote from H.J. Lu was:
> 
>   Never, never, never, never call "ld" directly to generate DSO
>   unless you know what you are doing. You should use "gcc -shared"
>   instead of "ld -Bshareable". Please read
> 
>   ftp://tsx-11.mit.edu/pub/linux/packages/GCC/elf.ps.gz
> 
> So, before we release Apache-1.3.7, I'd like to tweak apxs to use gcc
> -shared instead of ld -Bshareable on systems where we build with gcc unles
> someone objects.  Or Ralf, if you are listening, do you want to do it?

I cannot do it myself, but I can review patches someelse contributes.  But we
have to be carefully here: It's correct that "gcc -shared" is more correct
than fiddling around with "ld" ourself, _BUT_ not all GCC installations
support "gcc -shared", i.e. on a lot it's broken. So we cannot do a general
"gcc => use -shared for DSO building" rule, of course. It has to be done on a
per-platform basis. And even there it would be good to add a real-life test
before, because especially under Linux systems there exists a wide range of
GCC installations and I'm sure at least 20% are broken at "gcc -shared".

So when I would do it, I think src/Configure has to perform another DSO sanity
check and determines that "$CC -shared" works the same way as the hard-coded
"ld ..." call we should use it. Else we get into trouble, I think.

But it has nothing to do directly with apxs, I think. It's just a matter of
src/Configure to provide the correct (or more correct) values, isn't it?

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message