bug-glibc
[Top][All Lists]
Advanced

[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 16:12:11 -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'
make[2]: *** [/home3/dank/crosstool/build/sh4-linux/gcc-3.3/build-glibc/misc/ustat.o] Error 1

GOTO Masanori wrote about this same error in March on linux.debian.maint.glibc, archived at http://groups.google.com/groups?selm=20030322165012%247208%40gated-at.bofh.it
... [The initial definition of struct ustat is inadvertant, and caused by the 
following include chain:]
# 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" # 123 "/home3/dank/crosstool/result/sh4-linux/gcc-3.3/sh4-linux/include/linux/types.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 
*/sys/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 modify {s390,sh}/sys/user.h
to make them more like the other architectures, simply defining
struct user and any associated constants and types needed by gdb
rather than including real kernel headers.

Guess I'll give it a shot.  If anyone else has bumped into this or
thinks I'm on the wrong track, please let me know.

- Dan





reply via email to

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