[Zlib-devel] Explicit link to libc

John Bowler jbowler at frontiernet.net
Tue Mar 30 15:03:28 EDT 2010


This is moot now because Mark changed ./configure to not pass -lc in the MinGW build.  The only problem is that, as a side effect, 'LDSHARED' is no longer defined in the MinGW builds, but when that is fixed everything is fine.

(On 1.2.4.1 just copy the LDSHARED definition from the '*' case in ./configure, put it ahead of the LDSHAREDLIBC assign in the MINGW* case.)

From: Enrico Weigelt [mailto:weigelt at metux.de] 
>JBowler:
>> No, it depends on what $(LDSHARED) is; if it's ld or link the
>>language runtime (in this case the C runtime) must be given explicitly.
>
>What exactly happens when we leave it off ?

The link has unresolved references.  It's platform dependent whether or not this is permitted.

>Shouldn't libc linked into the final binary nevertheless ?

No, if the unresolved references are permitted then an attempt to resolve each one *may* be made at run time.  The resultant symbol doesn't necessarily come from 'libc'...

John Bowler <jbowler at acm.org>






More information about the Zlib-devel mailing list