Subject: pkg/37384: archivers/gzip fails to build with glibc-2.6 (linux)
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Yakovetsky Vladimir <yx@x.ua>
List: pkgsrc-bugs
Date: 11/14/2007 13:00:01
>Number:         37384
>Category:       pkg
>Synopsis:       archivers/gzip fails to build with glibc-2.6 (linux)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 14 13:00:01 +0000 2007
>Originator:     Yakovetsky Vladimir
>Release:        
>Environment:
System: Linux bres 2.6.21.5 #1 SMP Fri Jul 6 09:48:19 GMT 2007 i686 GNU/Linux

>Description:
	gnulib's futimens() conflict with glibc-2.6 futimens() declaration

>How-To-Repeat:
% uname -sr
Linux 2.6.21.5
% cd /usr/pkgsrc/archivers/gzip && bmake
...
gcc -std=gnu99 -DHAVE_CONFIG_H -I.      -O2 -march=native -mfpmath=sse -msse -finline-functions -fomit-frame-pointer -ffast-math -MT utimens.o -MD -MP -MF .deps/utimens.Tpo -c -o utimens.o utimens.c
In file included from ./sys/stat.h:27,
                 from ./fcntl.h:26,
                 from utimens.c:29:
///usr/include/sys/stat.h:370: error: conflicting types for 'futimens'
utimens.h:2: error: previous declaration of 'futimens' was here
...
Stop.


>Fix:
patch/patch-ac (futimens() renaming) based on
	gnulib/lib/utimens.c,v 1.15 2007/05/19
	gnulib/lib/utimens.h,v 1.4 2007/05/20
	gzip/gzip.c,v 1.19 2007/06/14
(pserver - cvs.savannah.gnu.org)

:r archivers/gzip/patches/patch-ac
--- gzip.c.orig
+++ gzip.c
@@ -1637,7 +1637,7 @@
 	}
       }
 
-    if (futimens (ofd, ofname, timespec) != 0)
+    if (gl_futimens (ofd, ofname, timespec) != 0)
       {
 	int e = errno;
 	WARN ((stderr, "%s: ", program_name));
--- lib/utimens.c.orig
+++ lib/utimens.c
@@ -75,7 +75,7 @@
    Return 0 on success, -1 (setting errno) on failure.  */
 
 int
-futimens (int fd ATTRIBUTE_UNUSED,
+gl_futimens (int fd ATTRIBUTE_UNUSED,
 	  char const *file, struct timespec const timespec[2])
 {
   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
@@ -185,5 +185,5 @@
 int
 utimens (char const *file, struct timespec const timespec[2])
 {
-  return futimens (-1, file, timespec);
+  return gl_futimens (-1, file, timespec);
 }
--- lib/utimens.h.orig
+++ lib/utimens.h
@@ -1,3 +1,3 @@
 #include <time.h>
-int futimens (int, char const *, struct timespec const [2]);
+int gl_futimens (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);