This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Question about another IA64 HP-UX build problem
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: drow at false dot org
- Cc: wilson at specifixinc dot com, binutils at gcc dot gnu dot org
- Date: Fri, 6 May 2005 08:45:01 -0700 (PDT)
- Subject: Re: Question about another IA64 HP-UX build problem
> > Here is the patch I came up with to address the getc_unlocked problem.
> > The problem is that HAVE_GETC_UNLOCKED is true (because HP-UX has it)
> > but the declaration isn't seen because we didn't compile with
> > -D_REENTRENT, thus we get a no-declaration error. Tested on IA64 HP-UX.
>
> If you're going to use BFD_NEED_DECLARATION, please use it to provide
> the declaration instead :-)
>
> --
> Daniel Jacobowitz
> CodeSourcery, LLC
I considered that, but I don't think I really want to do that. I don't
believe I should use getc_unlocked unless I have the official OS
declaration for it. If we were using a newer autoconf I would have
used 'AC_CHECK_DECLS(getc_unlocked)' and then my ifdef would have been:
#if defined(HAVE_GETC_UNLOCKED) && defined(HAVE_DECL_GETC_UNLOCKED)
which would look better but does the same thing.
The idea is to use getc_unlocked only if the OS provided a declaration
for it and not to use it if you just found it in libc but didn't see a
declaration for it.
On HP-UX the <stdio.h> header file will automatically convert getc into
getc_unlocked if you did not compile with -D_REENTRENT which tells the
compiler you are doing multithreaded stuff. Without the -D_REENTRENT
getc is unlocked anyway and the getc_unlocked declaration is not
visible.
Steve Ellcey
sje@cup.hp.com