Hello Alon, please don't top-post, thanks.
* Alon Bar-Lev wrote on Thu, Dec 03, 2009 at 09:28:59PM CET: > On Thu, Dec 3, 2009 at 10:17 PM, Ralf Wildenhues wrote: > > * Alon Bar-Lev wrote on Thu, Dec 03, 2009 at 07:08:03PM CET: > > > I have some convenience archives linked against several modules. > > > > > > I wish only required objects to be included in modules. > > > > Then make the convenience archives not be convenience archives any > > longer, i.e., make them libtool libraries. [...] > > In either case, they may end up being shared libraries (or both), so if > > you don't want that, add -static to libbar_la_LDFLAGS. > > I had to add -prefer-pic to CFLAGS in order it to work properly... :) > > Wow... this is an ugly workaround... Any reason why a simple switch to > "libtool --mode=link" is not supported? Yes, I think this is by intention. What you do is, at least most of the time, ugly. Why do you need the library to be PIC? Usually, the reason for that is that lib1.la does end up included in a, or a couple of, shared libraries or modules somewhere. And at that point, you risk (exposing your users to) subtle bugs: if code from lib1 is present in several places, and contains static state (example: last random number of a RNG), then on some systems, different parts of the running executable might suddenly use different instances of that state. Eww. Typically, that's the point at which developers reconsider to make lib1 a proper shared library. > Is it the first time someone needs this? No, but we've been able to convince most of the other guys that asked for this to reconsider. ;-) Cheers, Ralf _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool