"make sharedlib" fails in OSX (ld: unknown option: --soname)

Michael Tokarev mjt at tls.msk.ru
Fri Feb 18 10:54:53 MSK 2011


17.02.2011 20:36, Iñaki Baz Castillo wrote:
> 2011/2/14 Iñaki Baz Castillo <ibc at aliax.net>:
>> Hi, running "./configure && make sharedlib" fails under OSX:
>>
>> ------------------------------------
>> gcc -shared -Wl,--soname,libudns.so.0 -o libudns.so.0 udns_dn.lo
>> udns_dntosp.lo udns_parse.lo udns_resolver.lo udns_init.lo
>> udns_misc.lo udns_XtoX.lo udns_rr_a.lo udns_rr_ptr.lo udns_rr_mx.lo
>> udns_rr_txt.lo udns_bl.lo udns_rr_srv.lo udns_rr_naptr.lo
>> udns_codes.lo udns_jran.lo
>> ld: unknown option: --soname
>> collect2: ld returned 1 exit status
>> make: *** [libudns.so.0] Error 1
>> -------------------------------------
>>
>> It seems there is some issue with --soname option in certain OSX
>> versions, see http://old.nabble.com/Compile-Error-ipe-7.0.10-Mac-OS-X-10.5-%28Leopard%29-td27668421.html#a27668421

The Makefile is rather simplistic, especially for shared library.
If you take a look at GNU libtool source you'll see how many
various variants related to shared libraries there are, on
different operating systems.

It is more: gcc itself, while widely portable, can be unavailable
on any given target platform, instead, only proprietary vendor
compiler can be available - and that one wont support things
like -fPIC or -Wl.

The whole build system is supposed to build static library
correctly.  For shared library, there's just too many details
to cover, and I sort of expect the packagers who know their
systems better than me to help creating appropriate build
system.  Maybe I should just switch to autoconf & libtool,
which works on many systems already, -- it is not a big
deal to grow the package by some 500% at this time just
for the build system to work :)

/mjt


More information about the udns mailing list