non-recursive make (was: [PATCH input-synaptics 2/5] Do not install ChangeLog and README with documentation)

Daniel Stone daniel at fooishbar.org
Tue Jun 14 17:55:46 PDT 2011


Hi,

On Tue, Jun 14, 2011 at 05:42:44PM -0700, Dan Nicholson wrote:
> One thing I'd note is that I don't think libxorg.la is needed at all.
> It just collects a bunch of other convenience libraries together. You
> could just as easily add them directly to the Xorg link command.
> Especially since libtool is just turning around and doing the exact
> some process with the exact same objects in Xorg that it just did with
> libxorg.la. I started putting a patch together for that, but I'm
> getting undefined references on the link. I have to remember how
> libtool does things differently when making convenience libraries vs.
> programs.

When making convenience libraries, gcc/ld simply aggregate the
compiled source into a single unit and leaves it at that.  When doing
the final program link, they actively discard unused compilation units.

The process goes something like this:
    * load .a file
    * go through all referenced symbols, mark symbol as 'used', attempt
      to resolve symbol within same .o, then same .a, then anything
      linked earlier
    * for each .o, if no symbol in the file is marked used, or exported,
      discard the entire .o
    * rinse, repeat

(That is, IIRC.  ajax may have something to say on the matter.)

So you have to be really careful with link order; getting it exactly
right when I did the modular Xorg server took quite some time indeed.
I assume half the reason libxorg.a exists is so that we don't have to
worry about link order anymore: it's just a massive aggregation of the
entire source tree in object form.

The other upshot of this is that if you're getting missing-symbol
references when you'd really like not to, then just add random
nonsensical cross-references to make sure the object it's in isn't
getting marked as orphaned and discarded.

Cheers,
Daniel


More information about the xorg-devel mailing list