This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2]: configure: use the .set directive when testing for .weak


On 21 September 2010 12:45, Ulrich Drepper <drepper@gmail.com> wrote:
> On Tue, Sep 21, 2010 at 10:30, Linas Vepstas <linasvepstas@gmail.com> wrote:
>> When testing for the .weak assembler directive, use the .set syntax
>> if that is what the assembler supports; else use the "=" syntax for
>> setting symbols.
>
> You cannot possibly assume that I believe what you wrote just like
> that. ÂWhere do you see problem, which tools, etc etc.

Sorry, perhaps I was too concise.

I'm porting glibc to a new architecture, and hope to provide a full
set of glibc patches for this "real soon now" (maybe before the end
of the year?)

The core problem is that the assembler uses the = sign for loads
and stores, so e.g. "r21 = mem(r22)" is how one says "load r21
with mem location pointed at by r22".  (I didn't design this,
someone 'clever' came up with this long ago)  So,  to avoid getting
confused, the assembler uses the .set syntax for setting symbols.
When it saw the "foo = bar" in the configure test, it complained
that there aren't any registers called "foo" and "bar", and so the
.weak test failed out.

Without .weak support, glibc won't build -- a bunch of pthread
symbols get marked as U instead of W in libc.a, and the build
fails with unresolved pthread symbols when linking libdl.a, etc.

This, and the next patch, fixes this. Perhaps it doesn't
much matter without the rest of the port ... on the other hand,
maybe there are other poor arches out there that have been
bitten by this, so I figured that I'd submit this as a generic,
"good to have" patch, rather than as part of an arch port.

-- Linas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]