[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Build failure on AIX 4.3
From: |
Jim Meyering |
Subject: |
Re: Build failure on AIX 4.3 |
Date: |
Mon, 15 Jan 2007 16:41:04 +0100 |
"Daniel Richard G." <address@hidden> wrote:
> Building coreutils CVS on AIX 4.3 with GCC 4.1 ends with...
>
> ----BEGIN----
> gcc -std=gnu99 -I. -D_THREAD_SAFE -O0 -g3 -MT readutmp.o -MD -MP -MF
> .deps/readutmp.Tpo -c -o readutmp.o readutmp.c
> In file included from readutmp.h:39,
> from readutmp.c:24:
> /usr/include/utmpx.h:90: error: redefinition of 'struct utmp_data'
> In file included from readutmp.c:24:
> readutmp.h:143: warning: implicit declaration of function 'UT_USER'
> readutmp.c: In function 'extract_trimmed_name':
> readutmp.c:55: warning: passing argument 2 of 'strncpy' makes pointer from
> integer without a cast
> readutmp.c: In function 'desirable_utmp_entry':
> readutmp.c:72: error: subscripted value is neither array nor pointer
> make: 1254-004 The error code from the last command is 1.
> ----END----
...
Thanks for the report and analysis.
Here's a proposed patch for the gnulib readutmp module:
* m4/readutmp.m4 (gl_READUTMP): Work around AIX 4.3 struct-
redefinition bug when using both <utmp.h> and <utmpx.h> headers.
* lib/readutmp.h: Likewise. Reported by Daniel Richard G. in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9415>.
Here's a test tarball with that patch and all of the latest bits,
in case that makes it easier for you to test:
http://meyering.net/cu/coreutils-6.7-dirty.tar.gz
http://meyering.net/cu/coreutils-6.7-dirty.tar.gz.sig
Please try it and let us know.
Index: m4/readutmp.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/readutmp.m4,v
retrieving revision 1.14
diff -u -p -r1.14 readutmp.m4
--- m4/readutmp.m4 22 Sep 2006 18:09:47 -0000 1.14
+++ m4/readutmp.m4 15 Jan 2007 15:33:02 -0000
@@ -1,5 +1,5 @@
-# readutmp.m4 serial 12
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# readutmp.m4 serial 13
+dnl Copyright (C) 2002-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -28,6 +28,11 @@ $ac_includes_default
# include <utmpx.h>
#endif
#ifdef HAVE_UTMP_H
+# if defined _THREAD_SAFE && defined UTMP_DATA_INIT
+ /* When including both utmp.h and utmpx.h on AIX 4.3, with _THREAD_SAFE
+ defined, work around the duplicate struct utmp_data declaration. */
+# define utmp_data gl_aix_4_3_workaround_utmp_data
+# endif
# include <utmp.h>
#endif
"
Index: lib/readutmp.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/readutmp.h,v
retrieving revision 1.22
diff -u -p -r1.22 readutmp.h
--- lib/readutmp.h 18 Oct 2006 13:24:37 -0000 1.22
+++ lib/readutmp.h 15 Jan 2007 15:33:02 -0000
@@ -1,7 +1,6 @@
/* Declarations for GNU's read utmp module.
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1992-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,6 +35,11 @@
/* HPUX 10.20 needs utmp.h, for the definition of e.g., UTMP_FILE. */
# include <utmp.h>
# endif
+# if defined _THREAD_SAFE && defined UTMP_DATA_INIT
+ /* When including both utmp.h and utmpx.h on AIX 4.3, with _THREAD_SAFE
+ defined, work around the duplicate struct utmp_data declaration. */
+# define utmp_data gl_aix_4_3_workaround_utmp_data
+# endif
# include <utmpx.h>
# define UTMP_STRUCT_NAME utmpx
# define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_tv.tv_sec)