This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: libc_hidden_proto breaks things for PowerPC64
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Roland McGrath <roland at frob dot com>
- Cc: Alan Modra <amodra at bigpond dot net dot au>, Steve Munroe <sjmunroe at us dot ibm dot com>, libc-alpha at sources dot redhat dot com, Peter Bergner <bergner at us dot ibm dot com>
- Date: Tue, 20 Aug 2002 08:09:16 +0200
- Subject: Re: libc_hidden_proto breaks things for PowerPC64
- References: <20020817103006.V20056@bubble.sa.bigpond.net.au> <20020820012855.B97771BA18@perdition.linnaean.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Aug 19, 2002 at 09:28:55PM -0400, Roland McGrath wrote:
> > Roland, what do you mean by "fix the compiler support", especially in
> > regard to data definitions?
>
> With all the intermediate versions we had in this stuff I lost track of the
> fact that hidden_def is always done via asm. I don't know why it's that
> way (Jakub?).
That's because since gcc sees void foo (void) __asm ("bar"); it replaces
al occurences of foo in C program with bar in assembly, and we need to cheat
to generate foo into assembly.
You'd need either to tell gcc:
void foo (void) __asm ("bar");
void baz (void)
{
}
void foo (void) __attribute__ ((weak, alias ("baz")));
void foo (void) __asm ("foo") __attribute__ ((weak, alias ("bar")));
is ok (which currently certainly is not, the different __asm
causes a redefinition error), or come up with __attribute__((noasm))
or whatever:
void foo (void) __asm ("bar");
void baz (void)
{
}
void foo (void) __attribute__ ((weak, alias ("baz")));
void foo (void) __attribute__ ((noasm)) __attribute__ ((weak, alias ("bar")));
but I don't know if this problem is generic enough to be solved by gcc.
Jakub