Building and linking shared libaries for multiple differentversions of UNIX

Steve Langasek vorlon at netexpress.net
Wed May 16 14:25:04 GMT 2001


On Wed, 16 May 2001, David Collier-Brown wrote:

> Richard Sharpe wrote:

> > 1. Do the flags for generating PIC differ from system to system, esp if
> > using the native compilers?

> 	Slightly: Solaris SC6.1 defines -K PIC and -K pic,
> 	and allows you to say -KPIC and -Kpic.  You should
> 	always say PIC, not pic, as the small library option
> 	is only for **quite** small libraries. Smbwrappers
> 	is on th verge of overflowing it.

-KPIC, -fPIC, -fno-common, +z... there's quite a variety of flags available,
depending on the platform. :P  I imagine CUPS has a pretty extensive list.

> > 2. Can I get away with defining something like SOLDFLAGS, and simply pass
> > that to $(LD)?

> 	Yes, for Solaris and Linux.

Although on Linux, it's recommended that you use gcc for linking instead of
calling ld directly.

Steve Langasek
postmodern programmer





More information about the samba-technical mailing list