Linking the whole archive.

Scott Bailey <[email protected]> Fri, 13 Mar 2009 11:34:56 -0700
Newsgroups gmane.comp.sysutils.bakefile.devel
Message-ID <[email protected]>
Vacalv,

I am proposing adding a tag and am looking for feedback.


Background Information
----------------------------------

The project I'm working on has a multitude of pieces:

   1. A number of generic cross-platform support libraries (static
   libraries)
   2. A single project specific library (a shared library with static
   linkage)
   3. A number of plugables (modules) that depend on items 1 & 2 (shared
   libraries with dynamic linkage)
   4. A number of executable that depend on items 1 & 2 and may load any
   number of item 3s.


Items 2, 3, and 4 share a repository while item 1 is included via
'svn:exterals' and by including it's *.bkls via the other's (i.e item 2's
bkl includes item 1's bkl).

Ultimately, I want is to include item 1 inside item 2.  Iitems 3 and 4 then
depend only on item 2 and are smaller by losing the static linkage of item
1.  The alternative for me is to build all item 1 as a shared static; but I
would prefer to have a single shared static.  Regardless, I'd have the same
problem as all of the item 1's are currently independantly built.  This may
not make sense for most projects, but for mine it does.

Currently, I can do this in GNU's Makefiles (via the Bake ldflags and ldlibs
tags), but vc8's IDE requires a tag  where no support currently exists
("UseLibraryDependencyInputs").  I have not deeply researched the xcode2
solution, but I expect some option exists.  I have an OSX machine I can use
next week.

The GNU linker flags are '--whole-archive' and '--no-whole-archive'.  Maybe
OSX's linker takes '-all_load' as the appropriate option.


Proposal
-------------

I am suggesting adding a tag to allow this, maybe call it "all-objects" or
something.  This tag would only be applicable to dll and module rules.

In the gnu mode it would simply add:
 <ldflags>-Wl,--whole-archive</ldflags>
 <ldlibs>-Wl,--no-whole-archives</ldflags>

In MS projects that support it, it would use setAttribute to generate the
correct output.

Not sure what xcode implementation is like yet.



Comments?

-- 
Scott Bailey

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

_______________________________________________
Bakefile-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bakefile-devel