patch for building shared library on OS X

Nick Barkas snb at spotify.com
Mon Aug 22 17:39:01 MSD 2011


On Mon, Aug 22, 2011 at 8:34 AM, Michael Tokarev <mjt at tls.msk.ru> wrote:
> [Please excuse me for long delay answering - I was very busy]
>
> On 18.08.2011 15:03, Nick Barkas wrote:
>> Hi-
>> I saw that there was a message on this list a few months back about
>> not being able to build UDNS as a shared library on OS X. I have a
>> patch to Makefile.in that makes this work by building a new dylib make
>> target.
>
> So, there are only 2 differences from the already existing .so case:
> different extension (.dylib instead of .so) and different option
> (-dynamiclib instead of -shared).
>
> Does gcc understand -shared on this platform?  Or is this not gcc
> but some other compiler?

Mac OS X currently uses llvm-gcc, and the gcc parts of that have some
Apple-specific extensions. The -shared option is listed in the
included gcc man page [1], but under its description says "This option
is not supported on Mac OS X." Oddly enough, if I replace the
-dynamiclib option with -shared it does seem to produce an identical
library on my system to what -dynamiclib produces. I don't know if
this will be the case on all versions of OS X though given that the
man page says it's unsupported.

1: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/gcc.1.html


More information about the udns mailing list