This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Link failure in sigaction
- From: "Steve Munroe" <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: Roland McGrath <roland at redhat dot com>, geoffk at geoffk dot org
- Date: Wed, 18 Sep 2002 14:59:24 -0500
- Subject: Link failure in sigaction
Pulled the cvs head today and found the following link error in powerpc32
home/sjmunroe/work/build32-23/libc.so.6: undefined reference to
`__libc_sigaction'
/home/sjmunroe/work/build32-23/libc.so.6: undefined reference to
`__GI___sigaction'
collect2: ld returned 1 exit status
The problem seems to be that ./sysdeps/unix/sysv/linux/sigaction.c
(normally) defines __sigaction as a weak_alias of (__libc_sigaction). This
seems to disagree with the libc_hidden_proto and libc_hidden_weak stuff.
The sigaction.h redefines to __sigaction and __libc_sigaction to
__GI___sigaction and __GI___libc_sigaction.
extern int __sigaction (int __sig, __const struct sigaction *__restrict
__act,
struct sigaction *__restrict __oact);
libc_hidden_proto (__sigaction)
...
extern int __libc_sigaction (int sig, const struct sigaction *act,
struct sigaction *oact);
libc_hidden_proto (__libc_sigaction)
So when sigaction.c tries to make __sigaction a weak_alias of
__libc_sigaction, __libc_sigaction is not defined. So the statements:
weak_alias (__libc_sigaction, __sigaction)
libc_hidden_weak (__sigaction)
weak_alias (__libc_sigaction, sigaction)
Only generate references to nonexistent __libc_sigaction and
__GI___sigaction symbols.
I am still puzzling over how to fix/get around this ...