public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Patch for IA64 HP-UX build
@ 2005-05-04 23:59 Steve Ellcey
  2005-05-05  1:58 ` James E Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Steve Ellcey @ 2005-05-04 23:59 UTC (permalink / raw)
  To: binutils

I have been trying to build the latest binutils on IA64 HP-UX and ran
into several problems involving the newly added use of -Werror.  Here is
the first of several patches to fix them.  If approved, I think I need
someone to check it in for me too, I have GCC tree write access but I
have never checked anything in to the binutils tree.

The problem being addressed here is that bfd/sysdep.h only includes
strings.h if it hasn't already included string.h.  HP-UX has both and
ffs() is only defined in strings.h.  I hope there are no platforms where
including both will cause a problem.  If there are, HP-UX could also be
made to work by checking for strings.h before string.h.

Tested on an HP-UX IA64 build which gets further with this change then
without it.

Steve Ellcey
sje@cup.hp.com



bfd/ChangeLog:

2005-05-04  Steve Ellcey  <sje@cup.hp.com>

	 sysdep.h: Change ifdefs around include of string.h and strings.h.


*** src.orig/bfd/sysdep.h	Wed May  4 16:31:48 2005
--- src/bfd/sysdep.h	Wed May  4 16:32:00 2005
*************** extern int errno;
*** 41,53 ****
  
  #ifdef HAVE_STRING_H
  #include <string.h>
! #else
  #ifdef HAVE_STRINGS_H
  #include <strings.h>
! #else
  extern char *strchr ();
  extern char *strrchr ();
- #endif
  #endif
  
  #ifdef HAVE_STDLIB_H
--- 41,55 ----
  
  #ifdef HAVE_STRING_H
  #include <string.h>
! #endif
! 
  #ifdef HAVE_STRINGS_H
  #include <strings.h>
! #endif
! 
! #if !defined(HAVE_STRING_H) && !defined(HAVE_STRINGS_H)
  extern char *strchr ();
  extern char *strrchr ();
  #endif
  
  #ifdef HAVE_STDLIB_H

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-04 23:59 Patch for IA64 HP-UX build Steve Ellcey
@ 2005-05-05  1:58 ` James E Wilson
  2005-05-05 16:18   ` Steve Ellcey
  2005-05-05 16:37   ` Steve Ellcey
  0 siblings, 2 replies; 10+ messages in thread
From: James E Wilson @ 2005-05-05  1:58 UTC (permalink / raw)
  To: sje; +Cc: binutils

On Wed, 2005-05-04 at 16:57, Steve Ellcey wrote:
> I hope there are no platforms where including both will cause a problem.

Just checking gcc/system.h, I see that it has STRING_WITH_STRINGS and a
configure check to set it.  This support was added here:
    http://gcc.gnu.org/ml/gcc-patches/1998-08/msg00317.html
which suggests that including both can be unsafe, but offers no proof.

The configure test for this is ACX_HEADER_STRING which is in
config/acx.m4, which also happens to be in the binutils tree.  So it
would be possible for us to use it here.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05  1:58 ` James E Wilson
@ 2005-05-05 16:18   ` Steve Ellcey
  2005-05-05 16:32     ` Steve Ellcey
  2005-05-05 16:37   ` Steve Ellcey
  1 sibling, 1 reply; 10+ messages in thread
From: Steve Ellcey @ 2005-05-05 16:18 UTC (permalink / raw)
  To: wilson; +Cc: binutils

> The configure test for this is ACX_HEADER_STRING which is in
> config/acx.m4, which also happens to be in the binutils tree.  So it
> would be possible for us to use it here.
> -- 
> Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

Yes, that seems to work fine.  Here is a modified patch that I tested.

Steve Ellcey
sje@cup.hp.com



bfd/ChangeLog:

2005-05-05  Steve Ellcey  <sje@cup.hp.com>

	configure.in: Add ACX_HEADER_STRING check.
	configure: Regenerate.
	sysdep.h: Change ifdefs around include of string.h and strings.h.


*** src.orig/bfd/configure.in	Thu May  5 09:05:21 2005
--- src/bfd/configure.in	Thu May  5 09:05:05 2005
*************** AC_CHECK_HEADERS(stddef.h string.h strin
*** 124,129 ****
--- 124,130 ----
  AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
  AC_HEADER_TIME
  AC_HEADER_DIRENT
+ ACX_HEADER_STRING
  AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
  AC_CHECK_FUNCS(strtoull)
  
*** src.orig/bfd/sysdep.h	Wed May  4 16:31:48 2005
--- src/bfd/sysdep.h	Thu May  5 09:00:10 2005
*************** Foundation, Inc., 51 Franklin Street - F
*** 39,44 ****
--- 39,48 ----
  extern int errno;
  #endif
  
+ #ifdef STRING_WITH_STRINGS
+ #include <string.h>
+ #include <strings.h>
+ #else
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
*************** extern int errno;
*** 47,52 ****
--- 51,57 ----
  #else
  extern char *strchr ();
  extern char *strrchr ();
+ #endif
  #endif
  #endif
  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05 16:18   ` Steve Ellcey
@ 2005-05-05 16:32     ` Steve Ellcey
  0 siblings, 0 replies; 10+ messages in thread
From: Steve Ellcey @ 2005-05-05 16:32 UTC (permalink / raw)
  To: wilson; +Cc: binutils

Woops, that last mail went out too fast and I was looking at the wrong
output.  I think my patch isn't setting STRING_WITH_STRINGS for some
reason.  I need to look at it a little more.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05  1:58 ` James E Wilson
  2005-05-05 16:18   ` Steve Ellcey
@ 2005-05-05 16:37   ` Steve Ellcey
  2005-05-05 16:48     ` Daniel Jacobowitz
  2005-05-05 16:58     ` H. J. Lu
  1 sibling, 2 replies; 10+ messages in thread
From: Steve Ellcey @ 2005-05-05 16:37 UTC (permalink / raw)
  To: wilson; +Cc: binutils

> The configure test for this is ACX_HEADER_STRING which is in
> config/acx.m4, which also happens to be in the binutils tree.  So it
> would be possible for us to use it here.
> -- 
> Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

OK, Here is a new version of the patch using ACX_HEADER_STRING.  In my
first attempt I forgot to put the undef of ACX_HEADER_STRING into
config.in.  This one has been tested and all of bfd built on IA64 HP-UX.

Steve Ellcey
sje@cup.hp.com


bfd/ChangeLog:

2005-05-05  Steve Ellcey  <sje@cup.hp.com>

	configure.in: Add ACX_HEADER_STRING check.
	configure: Regenerate.
	config.in: Add undef of STRING_WITH_STRINGS.
	sysdep.h: Change ifdefs around include of string.h and strings.h.


*** src.orig/bfd/configure.in	Thu May  5 09:05:21 2005
--- src/bfd/configure.in	Thu May  5 09:05:05 2005
*************** AC_CHECK_HEADERS(stddef.h string.h strin
*** 124,129 ****
--- 124,130 ----
  AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
  AC_HEADER_TIME
  AC_HEADER_DIRENT
+ ACX_HEADER_STRING
  AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
  AC_CHECK_FUNCS(strtoull)
  
*** src.orig/bfd/config.in	Thu May  5 09:22:03 2005
--- src/bfd/config.in	Thu May  5 09:21:53 2005
***************
*** 322,327 ****
--- 322,330 ----
  /* Define to 1 if you have the ANSI C header files. */
  #undef STDC_HEADERS
  
+ /* Define if you can safely include both <string.h> and <strings.h>. */
+ #undef STRING_WITH_STRINGS
+ 
  /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
  #undef TIME_WITH_SYS_TIME
  
*** src.orig/bfd/sysdep.h	Wed May  4 16:31:48 2005
--- src/bfd/sysdep.h	Thu May  5 09:00:10 2005
*************** Foundation, Inc., 51 Franklin Street - F
*** 39,44 ****
--- 39,48 ----
  extern int errno;
  #endif
  
+ #ifdef STRING_WITH_STRINGS
+ #include <string.h>
+ #include <strings.h>
+ #else
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
*************** extern int errno;
*** 47,52 ****
--- 51,57 ----
  #else
  extern char *strchr ();
  extern char *strrchr ();
+ #endif
  #endif
  #endif
  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05 16:37   ` Steve Ellcey
@ 2005-05-05 16:48     ` Daniel Jacobowitz
  2005-05-05 17:14       ` Steve Ellcey
  2005-05-05 16:58     ` H. J. Lu
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2005-05-05 16:48 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: wilson, binutils

On Thu, May 05, 2005 at 09:32:08AM -0700, Steve Ellcey wrote:
> > The configure test for this is ACX_HEADER_STRING which is in
> > config/acx.m4, which also happens to be in the binutils tree.  So it
> > would be possible for us to use it here.
> > -- 
> > Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
> 
> OK, Here is a new version of the patch using ACX_HEADER_STRING.  In my
> first attempt I forgot to put the undef of ACX_HEADER_STRING into
> config.in.  This one has been tested and all of bfd built on IA64 HP-UX.

That's a generated file - run autoheader.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05 16:37   ` Steve Ellcey
  2005-05-05 16:48     ` Daniel Jacobowitz
@ 2005-05-05 16:58     ` H. J. Lu
  1 sibling, 0 replies; 10+ messages in thread
From: H. J. Lu @ 2005-05-05 16:58 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: wilson, binutils

On Thu, May 05, 2005 at 09:32:08AM -0700, Steve Ellcey wrote:
> > The configure test for this is ACX_HEADER_STRING which is in
> > config/acx.m4, which also happens to be in the binutils tree.  So it
> > would be possible for us to use it here.
> > -- 
> > Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
> 
> OK, Here is a new version of the patch using ACX_HEADER_STRING.  In my
> first attempt I forgot to put the undef of ACX_HEADER_STRING into
> config.in.  This one has been tested and all of bfd built on IA64 HP-UX.
> 
> Steve Ellcey
> sje@cup.hp.com
> 
> 
> bfd/ChangeLog:
> 
> 2005-05-05  Steve Ellcey  <sje@cup.hp.com>
> 
> 	configure.in: Add ACX_HEADER_STRING check.
> 	configure: Regenerate.
> 	config.in: Add undef of STRING_WITH_STRINGS.

config.in is generated by autoheader.


H.J.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05 16:48     ` Daniel Jacobowitz
@ 2005-05-05 17:14       ` Steve Ellcey
  2005-05-05 17:52         ` James E Wilson
  2005-05-05 19:28         ` James E Wilson
  0 siblings, 2 replies; 10+ messages in thread
From: Steve Ellcey @ 2005-05-05 17:14 UTC (permalink / raw)
  To: drow; +Cc: wilson, binutils, hjl

> > OK, Here is a new version of the patch using ACX_HEADER_STRING.  In my
> > first attempt I forgot to put the undef of ACX_HEADER_STRING into
> > config.in.  This one has been tested and all of bfd built on IA64 HP-UX.
> 
> That's a generated file - run autoheader.
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery, LLC

So it is.  I guess that means my first patch was right, other than
needing a 'regenerate' line in ChangeLog for config.in.  Here is that
patch again with the modified ChangeLog (and after running autoheader
and retesting to make sure nothing broke).

bfd/ChangeLog:

2005-05-05  Steve Ellcey  <sje@cup.hp.com>

	configure.in: Add ACX_HEADER_STRING check.
	configure: Regenerate.
	config.in: Regenerate.
	sysdep.h: Change ifdefs around include of string.h and strings.h.


*** src.orig/bfd/configure.in	Thu May  5 09:05:21 2005
--- src/bfd/configure.in	Thu May  5 09:05:05 2005
*************** AC_CHECK_HEADERS(stddef.h string.h strin
*** 124,129 ****
--- 124,130 ----
  AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
  AC_HEADER_TIME
  AC_HEADER_DIRENT
+ ACX_HEADER_STRING
  AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
  AC_CHECK_FUNCS(strtoull)
  
*** src.orig/bfd/sysdep.h	Wed May  4 16:31:48 2005
--- src/bfd/sysdep.h	Thu May  5 09:00:10 2005
*************** Foundation, Inc., 51 Franklin Street - F
*** 39,44 ****
--- 39,48 ----
  extern int errno;
  #endif
  
+ #ifdef STRING_WITH_STRINGS
+ #include <string.h>
+ #include <strings.h>
+ #else
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
*************** extern int errno;
*** 47,52 ****
--- 51,57 ----
  #else
  extern char *strchr ();
  extern char *strrchr ();
+ #endif
  #endif
  #endif
  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05 17:14       ` Steve Ellcey
@ 2005-05-05 17:52         ` James E Wilson
  2005-05-05 19:28         ` James E Wilson
  1 sibling, 0 replies; 10+ messages in thread
From: James E Wilson @ 2005-05-05 17:52 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: drow, binutils, H. J. Lu

On Thu, 2005-05-05 at 09:57, Steve Ellcey wrote:
> 	configure.in: Add ACX_HEADER_STRING check.
> 	configure: Regenerate.
> 	config.in: Regenerate.
> 	sysdep.h: Change ifdefs around include of string.h and strings.h.

OK.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Patch for IA64 HP-UX build
  2005-05-05 17:14       ` Steve Ellcey
  2005-05-05 17:52         ` James E Wilson
@ 2005-05-05 19:28         ` James E Wilson
  1 sibling, 0 replies; 10+ messages in thread
From: James E Wilson @ 2005-05-05 19:28 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: drow, binutils, H. J. Lu

On Thu, 2005-05-05 at 09:57, Steve Ellcey wrote:
> 	configure.in: Add ACX_HEADER_STRING check.
> 	configure: Regenerate.
> 	config.in: Regenerate.
> 	sysdep.h: Change ifdefs around include of string.h and strings.h.

I checked it in for you.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-05-05 19:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-04 23:59 Patch for IA64 HP-UX build Steve Ellcey
2005-05-05  1:58 ` James E Wilson
2005-05-05 16:18   ` Steve Ellcey
2005-05-05 16:32     ` Steve Ellcey
2005-05-05 16:37   ` Steve Ellcey
2005-05-05 16:48     ` Daniel Jacobowitz
2005-05-05 17:14       ` Steve Ellcey
2005-05-05 17:52         ` James E Wilson
2005-05-05 19:28         ` James E Wilson
2005-05-05 16:58     ` H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).