[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Build failure on AIX 4.3

From: Daniel Richard G.
Subject: Build failure on AIX 4.3
Date: Sun, 14 Jan 2007 19:51:46 -0500

Building coreutils CVS on AIX 4.3 with GCC 4.1 ends with...

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.

Also, have a look at this excerpt from the configure script output:

checking whether getutent is declared... no
checking for struct utmpx.ut_user... no
checking for struct utmp.ut_user... no
checking for struct utmpx.ut_name... no
checking for struct utmp.ut_name... no
checking for struct utmpx.ut_type... no
checking for struct utmp.ut_type... no
checking for struct utmpx.ut_pid... no
checking for struct utmp.ut_pid... no
checking for struct utmpx.ut_id... no
checking for struct utmp.ut_id... no
checking for struct utmpx.ut_exit... no
checking for struct utmp.ut_exit... no
checking for struct utmpx.ut_exit.ut_exit... no
checking for struct utmp.ut_exit.ut_exit... no
checking for struct utmpx.ut_exit.e_exit... no
checking for struct utmp.ut_exit.e_exit... no
checking for struct utmpx.ut_exit.ut_termination... no
checking for struct utmp.ut_exit.ut_termination... no
checking for struct utmpx.ut_exit.e_termination... no
checking for struct utmp.ut_exit.e_termination... no

Inspection confirms that both struct utmp and struct utmpx have a .ut_user 
field, as well as some others in the above list. So what's going on? Look 
up the utmpx.ut_user check in config.log:

configure:34731: checking for struct utmpx.ut_user
configure:34760: gcc -std=gnu99 -c -pedantic -pipe -W -Wall -Wcast-align 
-Wformat=2 -Winline -Wpointer-arith -Wundef -Waggregate-return -Wcast-qual 
-Wmissing-declarations -Wnested-externs -Wstrict-prototypes -O3 -D_ALL_SOURCE 
-D_THREAD_SAFE conftest.c >&5
In file included from conftest.c:325:
/usr/include/utmp.h:90: error: redefinition of 'struct utmp_data'
conftest.c:331: warning: function declaration isn't a prototype
configure:34766: $? = 1
configure: failed program was:

Again, that bit about redefining 'struct utmp_data'. What's going on in 
that header file?

----BEGIN /usr/include/utmp.h EXCERPT----
struct utmp_data {
        int             ut_fd;
        long            loc_utmp;
        struct utmp     ubuf;
        char            *name;
#define UTMP_DATA_INIT(__s) (__s.ut_fd=-1, __s.name=UTMP_FILE)
#endif /* _THREAD_SAFE */
----END /usr/include/utmp.h EXCERPT----

The kicker: utmpx.h has that *same exact* fragment as well.

Meaning that, if you define _THREAD_SAFE (which the configure script does 
for you, if it detects an AIX platform), then you can't #include both 
utmp.h and utmpx.h. A trivial program is enough to confirm this:

#define _THREAD_SAFE
#include <utmpx.h>
#include <utmp.h>

int main(void) { return 0; }

The coreutils build system isn't taking this restriction into account.

(Please Cc: any replies to me, as I am not subscribed to this list)


NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = address@hidden        ##  don't smell bad---    (/o|o\) /
EMAIL2 = address@hidden      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
(****** = site not yet online)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]