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

Iñaki Baz Castillo ibc at aliax.net
Thu Feb 17 20:36:07 MSK 2011


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
>
>
> udns Makefile.in indeed makes usage of such option:
>
> Makefile.in in udns-0.1 contains this:
> -----------------------------
> sharedlib: $(SOLIBV)
>
> $(SOLIBV): $(SOBJS)
>        $(CC) -shared -Wl,--soname,$(SOLIBV) -o $@ $(SOBJS)
> -----------------------------
>
> Is there some workaround for this?
>
> Thanks a lot.

It seems that --soname is not a portable option in ld command, and in
OSX -dylib_install_name is required instead. Perhaps the Makefile.in
could take it into account so depending on the architecture uses one
or the other?


-- 
Iñaki Baz Castillo
<ibc at aliax.net>


More information about the udns mailing list