This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
bootstrap/3162: libiberty's test for working strncmp fails on some systems
- To: gcc-gnats at gcc dot gnu dot org
- Subject: bootstrap/3162: libiberty's test for working strncmp fails on some systems
- From: john at Calva dot COM
- Date: Wed, 13 Jun 2001 13:10:32 +0200 (CEST)
>Number: 3162
>Category: bootstrap
>Synopsis: libiberty's test for working strncmp fails on some systems
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 13 04:16:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: John Hughes
>Release: 3.0 20010611 (prerelease)
>Organization:
CalvaEDI S.A.
>Environment:
System: UnixWare oceanic 5 7.1.1 i386 x86at SCO UNIX_SVR5
host: i586-sco-sysv5uw7.1.1
build: i586-sco-sysv5uw7.1.1
target: i586-sco-sysv5uw7.1.1
configured with: ../gcc-3.0-20010611/configure --prefix=/u/local --with-local_prefix=/u/local
>Description:
libiberty/aclocal.m4 has a check to see if strncmp runs off the
end of the string. It incorrectly fails on systems where
MAP_ANON(YMOUS) must be used without an open fd, for example
UnixWare 7.1.1.
>How-To-Repeat:
Run configure
>Fix:
--- libiberty/aclocal.m4.orig Wed Nov 22 09:32:26 2000
+++ libiberty/aclocal.m4 Wed Jun 13 12:48:35 2001
@@ -21,8 +21,6 @@
#ifndef MAP_ANON
#ifdef MAP_ANONYMOUS
#define MAP_ANON MAP_ANONYMOUS
-#else
-#define MAP_ANON MAP_FILE
#endif
#endif
@@ -39,6 +37,10 @@
{
#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
char *p;
+#ifdef MAP_ANON
+ p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
+ MAP_ANON|MAP_PRIVATE, -1, 0);
+#else
int dev_zero;
dev_zero = open ("/dev/zero", O_RDONLY);
@@ -46,7 +48,8 @@
exit (1);
p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
- MAP_ANON|MAP_PRIVATE, dev_zero, 0);
+ MAP_FILE|MAP_PRIVATE, dev_zero, 0);
+#endif
if (p == (char *)-1)
exit (2);
else
>Release-Note:
>Audit-Trail:
>Unformatted: