non-recursive make (was: [PATCH input-synaptics 2/5] Do not install ChangeLog and README with documentation)
Dan Nicholson
dbn.lists at gmail.com
Tue Jun 14 18:22:39 PDT 2011
On Tue, Jun 14, 2011 at 5:55 PM, Daniel Stone <daniel at fooishbar.org> wrote:
> 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.
Yeah, I think you're right. I fixed one of my undefined references by
moving libcommon.la before libxorgos.la because it couldn't find
xf86RemoveSIGIOHandler. That is convenient of libtool to put all the
symbols in one archive for me so the linker can see them all. I'll see
if I can make it work, but it would probably always be a bit fragile.
--
Dan
More information about the xorg-devel
mailing list