This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: __errno_location export
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Momchil Velikov <velco at fadata dot bg>
- Cc: Roland McGrath <roland at redhat dot com>, libc-alpha at sources dot redhat dot com
- Date: Sun, 1 Dec 2002 22:26:52 +0100
- Subject: Re: __errno_location export
- References: <874ra6v8e4.fsf@merlin.maxx.bg> <200211250000.gAP00OE06993@magilla.sf.frob.com> <20021125011005.B7036@sunsite.ms.mff.cuni.cz> <871y51trpi.fsf@merlin.maxx.bg>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Dec 01, 2002 at 10:22:17PM +0200, Momchil Velikov wrote:
> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
>
> Jakub> 2002-11-25 Jakub Jelinek <jakub@redhat.com>
>
> Jakub> * include/errno.h (__set_errno): Define as errno = val
> Jakub> unconditionally.
>
> This way I get undefined references to errno, most probably because of
> the following in sysdeps/generic/errno.c
The above mentioned change has nothing to do with export of errno.
> /* We declare these with compat_symbol so that they are not
> visible at link time. Programs must use the accessor functions. */
> # if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
> # include <shlib-compat.h>
> compat_symbol (libc, errno, errno, GLIBC_2_0);
> compat_symbol (libc, _errno, _errno, GLIBC_2_0);
> # endif
> #endif
It depends if your port is using __errno_location in bits/errno.h as
definition of errno, or not. If yes, then not exporting errno as link time
symbol is desirable, otherwise you IMHO shouldn't be using
sysdeps/generic/errno.c.
Jakub