Bug 14028 - Need to #include both <string.h> and <strings.h> on AIX
Summary: Need to #include both <string.h> and <strings.h> on AIX
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 20:14 UTC by Daniel Richard G.
Modified: 2012-05-11 14:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Patch against current binutils CVS source (1.14 KB, patch)
2012-04-27 20:14 UTC, Daniel Richard G.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Richard G. 2012-04-27 20:14:00 UTC
Created attachment 6378 [details]
Patch against current binutils CVS source

I encountered some trouble building binutils 2.22 on AIX 4.3; specifically, str[n]casecmp() would come up as an implicitly-defined function, causing the build to fail due to -Werror.

str[n]casecmp() is declared in <strings.h>. If you look in binutils/bfd/, the configure script invokes ACX_HEADER_STRING, and sysdep.h #includes both <string.h> and <strings.h> if STRING_WITH_STRINGS is defined. This is exactly what needs to happen to get str[n]casecmp() along with the usual string.h functions on many systems.

The problem is, this does not currently happen in binutils/binutils/, binutils/gas/, binutils/ld/ and binutils/opcodes/. Thus there is breakage.

The attached patch, against current CVS, is a first stab at addressing the issue.
Comment 1 Sourceware Commits 2012-05-11 14:25:34 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2012-05-11 14:25:30

Modified files:
	gas            : ChangeLog configure configure.in as.h 
	ld             : ChangeLog config.in configure configure.in 
	                 sysdep.h 
	binutils       : ChangeLog configure configure.in sysdep.h 
	opcodes        : ChangeLog config.in configure configure.in 
	                 sysdep.h 

Log message:
	PR binutils/14028
	* configure.in: Invoke ACX_HEADER_STRING.
	* configure: Regenerate.
	* config.in: Regenerate.
	* sysdep.h: If STRINGS_WITH_STRING is defined then include both
	string.h and strings.h.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4728&r2=1.4729
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/configure.diff?cvsroot=src&r1=1.267&r2=1.268
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/configure.in.diff?cvsroot=src&r1=1.228&r2=1.229
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/as.h.diff?cvsroot=src&r1=1.69&r2=1.70
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2438&r2=1.2439
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/config.in.diff?cvsroot=src&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/configure.diff?cvsroot=src&r1=1.119&r2=1.120
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/configure.in.diff?cvsroot=src&r1=1.74&r2=1.75
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/sysdep.h.diff?cvsroot=src&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1902&r2=1.1903
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/configure.diff?cvsroot=src&r1=1.145&r2=1.146
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/configure.in.diff?cvsroot=src&r1=1.109&r2=1.110
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/sysdep.h.diff?cvsroot=src&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/ChangeLog.diff?cvsroot=src&r1=1.1808&r2=1.1809
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/config.in.diff?cvsroot=src&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/configure.diff?cvsroot=src&r1=1.139&r2=1.140
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/configure.in.diff?cvsroot=src&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/sysdep.h.diff?cvsroot=src&r1=1.8&r2=1.9
Comment 2 Nick Clifton 2012-05-11 14:28:25 UTC
Hi Daniel,

  I have checked in your patch and closed this PR.  If your build problems persist please reopen the PR.

Cheers
  Nick