[Top][All Lists]

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

Re: struct ustat defined twice: gcc-3.3's include/linux/types.h and glib

From: Dan Kegel
Subject: Re: struct ustat defined twice: gcc-3.3's include/linux/types.h and glibc-2.3.2's sysdeps/generic/bits/ustat.h
Date: Tue, 27 May 2003 15:28:36 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3

Dan Kegel wrote:
When I try to build glibc-2.3.2 with gcc-3.3 for sh4 ...,
I get the following error:

In file included from sys/ustat.h:30,
                 from ../sysdeps/unix/sysv/linux/ustat.c:21:
../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat'...

[The include chain causing the initial definition is:]

# 20 "../sysdeps/unix/sysv/linux/ustat.c"
# 22 "../include/errno.h"
# 1 "../include/tls.h" 1
# 125 "../linuxthreads/sysdeps/sh/tls.h"
# 26 "../linuxthreads/descr.h" 2
# 7 "../linuxthreads_db/thread_dbP.h" 2
# 20 "../linuxthreads_db/proc_service.h"
# 30 "../sysdeps/unix/sysv/linux/sys/procfs.h" 2
# 24 "../sysdeps/unix/sysv/linux/sh/sys/user.h"
# 1 "/home3/dank/crosstool/result/sh4-linux/gcc-3.3/sh4-linux/include/asm/user.h" 1 3 4 # 123 "/home3/dank/crosstool/result/sh4-linux/gcc-3.3/sh4-linux/include/linux/types.h" ...

It looks like the problem may have been introduced with this change to libc's 


2002-07-30  Roland McGrath  <address@hidden>
        * include/errno.h: Include <tls.h> to make sure USE_TLS defined by the
        time we test it.
        * include/errno.h: Protect from multiple inclusion.

Before that change, errno.h did not include tls.h.

And sure enough, only the two architectures that fail to build have
an include of asm/user.h from inside their sys/user.h:

address@hidden:~/glibc-2.3.2/sysdeps/unix/sysv/linux$ grep asm.user.h 
s390/sys/user.h:#include <asm/user.h>
sh/sys/user.h:#include <asm/user.h>

All other sys/user.h's have the comment

/* The whole purpose of this file is for GDB and GDB only.  Don't read
   too much into it.  Don't use it for anything other than GDB unless
   you know what you are doing.  */

and avoid including asm/user.h.

So it looks like the right fix is to replace the #includes in
{s390,sh}/sys/user.h with a simple definition of struct user and
any associated constants and types needed by gdb.

- Dan

reply via email to

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