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: wilson at specifixinc dot com
- Cc: binutils at gcc dot gnu dot org
- Date: Thu, 5 May 2005 16:25:38 -0700 (PDT)
- Subject: Re: Question about another IA64 HP-UX build problem
> getc_unlocked isn't used anywhere else in binutils simply because no one
> else has found a need for it, or perhaps, the idea of using it hasn't
> occurred to anyone else yet.
> --
> Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
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.
binutils/ChangeLog:
2005-05-05 Steve Ellcey <sje@cup.hp.com>
configure.in: Check for getc_unlocked prototype.
configure: Regenerate
config.in: Regenerate
strings.c: Only call getc_unlocked if we have seen a prototype.
*** src.orig/binutils/configure.in Thu May 5 16:21:14 2005
--- src/binutils/configure.in Thu May 5 16:20:28 2005
*************** BFD_NEED_DECLARATION(strstr)
*** 217,222 ****
--- 217,223 ----
BFD_NEED_DECLARATION(sbrk)
BFD_NEED_DECLARATION(getenv)
BFD_NEED_DECLARATION(environ)
+ BFD_NEED_DECLARATION(getc_unlocked)
BFD_BINARY_FOPEN
*** src.orig/binutils/strings.c Thu May 5 16:21:08 2005
--- src/binutils/strings.c Thu May 5 16:20:33 2005
*************** get_char (FILE *stream, file_off *addres
*** 447,453 ****
{
if (stream == NULL)
return EOF;
! #ifdef HAVE_GETC_UNLOCKED
c = getc_unlocked (stream);
#else
c = getc (stream);
--- 447,453 ----
{
if (stream == NULL)
return EOF;
! #if defined(HAVE_GETC_UNLOCKED) && !defined(NEED_DECLARATION_GETC_UNLOCKED)
c = getc_unlocked (stream);
#else
c = getc (stream);