On Wed, Jul 25, 2012 at 5:12 PM, Andrew Paprocki
<
andrew.m...@gmail.com> wrote:
> On Wed, Jul 25, 2012 at 2:41 PM, Dirk Pranke <
dpr...@chromium.org> wrote:
>> Most linkers have a way to force all of the symbols/archive members to
>> be included, but this is something of a hack and can have
>
> I'll take a look at the files you mentioned.
>
> gyp does exactly what you describe by specifying --whole-archive. The
> link would actually work if gyp would run the link command with only
> dependencies specified and no source files.
>
>
http://code.google.com/p/gyp/source/browse/trunk/pylib/gyp/generator/make.py#141
>
So, that's an example of "most linkers have a way", and if I knew that
gyp told make to use this flag, I'd forgotten it :)
However, relying on this behavior has the drawbacks that I described
(the potential for multiple definitions, the lack of dead code
elimination), so I don't recommend it, and I'd be surprised if
Chromium relied on this anywhere (Nico or Scott can correct me if I'm
wrong here).
That said, it could be that it would work for you in the situation
you're dealing with. I defer to the other committers if they think
this should "just work" or should be a configurable flag or something.
-- Dirk