[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disable --whole-archive when using convenience archives
From: |
Alon Bar-Lev |
Subject: |
Re: Disable --whole-archive when using convenience archives |
Date: |
Thu, 3 Dec 2009 22:52:00 +0200 |
Hello,
On Thu, Dec 3, 2009 at 10:39 PM, Ralf Wildenhues <address@hidden> wrote:
> * Alon Bar-Lev wrote on Thu, Dec 03, 2009 at 09:28:59PM CET:
>> 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.
Oh... It depends of how you perceive ugly... :)
Well... I have a plugin which shares code with programs. The plugin
should be self-contained. And I have .a libraries which are common to
both.
In order to support this I must use this workaround for all libraries
which are common to the plugin and the module.
I just finished migrating a proprietary build system into
autoconf/automake/libtool and this simple task became the most complex
one.
> 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.
True. I need to be linked into .so which is a standalone plugin.
> 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.
Well... I can think of a lot of bug that may result from incorrect use
of tools...
> Typically, that's the point at which developers reconsider to make lib1
> a proper shared library.
Yes, but I cannot have dependencies for my plugin .so implementation.
>> 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. ;-)
I see... :)
Thank you for your help... As long as there is a workaround I am
happy... But... I think this requirement is not so extra ordinary.
Thank you,
Alon.