Boost logo

Boost-Build :

From: Christopher Currie (codemonkey_at_[hidden])
Date: 2004-06-03 10:11:45


The short answer: GCC on Solaris by default will complain if you try to
link non-PIC code into a shared library. It took me until now to find
the flag that turns off the fatal error.

>From some previous posts on the devel list, I saw that there's
sometimes a performance benefit to having a non-PIC shared library, at
the cost of additional memory usage and a longer load time, because the
library is no longer truly "shared" (although still dynamically linked).

Because of this, I didn't want to force PIC on Solaris users who might
not want it, so I felt it's best to turn off the warning. Users can
always turn it back on using <linkflag>"-Wl,-z -Wl,text". (which is how
GCC turns it on in the first place).

As an aside, perhaps we should add a <pic> feature, with values 'none',
'small', and 'large'. I'd also consider renaming <link>shared to
<link>dynamic, although such a change would probably break too much
existing code to be worth it.

Vladimir Prus wrote:
> BTW, do you specifically want non-PIC code in shared library, or the problem
> is that V2 does not pass any -fPIC options at all?

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk