Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 89836 - sys-apps/kbd-1.12-r4 failed (linux-2.6.11 headers)
Summary: sys-apps/kbd-1.12-r4 failed (linux-2.6.11 headers)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
: 89902 89952 90000 90013 90235 92472 93299 93534 93940 94157 103671 116808 138659 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-20 10:14 UTC by Wayne
Modified: 2006-07-01 00:00 UTC (History)
18 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for gentoo kernel header modification of linux-headers (patch,343 bytes, patch)
2005-05-22 13:24 UTC, kdt3rd
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne 2005-04-20 10:14:52 UTC
updating from kbd 1.12-r3 to r4 causes error

Reproducible: Always
Steps to Reproduce:
1. ACCEPT_KEYWORDS="~amd64" emerge kdb
2.
3.

Actual Results:  
In file included from dumpkeys.c:13:
/usr/include/linux/keyboard.h:7:2: warning: #warning Gentoo Linux Headers
Warning: GNU Libc Linux Headers Override Detected.
/usr/include/linux/keyboard.h:8:2: warning: #warning Gentoo Linux Headers
Warning: This is bad. Removing override and continuing.
/usr/include/linux/keyboard.h:9:2: warning: #warning Gentoo Linux Headers
Warning: If your compilation dies here, mention this when
/usr/include/linux/keyboard.h:10:2: warning: #warning Gentoo Linux Headers
Warning: filing a bug!
In file included from /usr/include/linux/keyboard.h:11,
                 from dumpkeys.c:13:
/usr/include/linux/types.h:182: error: redefinition of `struct ustat'
make[1]: *** [dumpkeys.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/kbd-1.12-r4/work/kbd-1.12/src'
make: *** [all] Error 1

!!! ERROR: sys-apps/kbd-1.12-r4 failed.
!!! Function src_compile, Line 69, Exitcode 2
!!! emake failed
!!! If you need support, post the topmost build error, NOT this status message.



Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3-20050110,
glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 20 2005, 07:21:22)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.8.5-r3, 1.5, 1.7.9-r1, 1.6.3, 1.4_p6, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CFLAGS="-O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X acpi alsa berkdb bitmap-fonts crypt fam font-server fortran gif gpm
ipv6 jp2 jpeg kde lzw lzw-tiff motif mp3 ncurses nls opengl oss pam perl png
python qt readline ssl tcpd tiff truetype truetype-fonts type1-fonts usb
userlocales xml2 xpm xrandr xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Alexander Rigbo 2005-04-20 12:51:20 UTC
I have the same error.

walnut src # emerge info
Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 20 2005, 19:44:39)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="amd64 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe -w -march=k8"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -pipe -w -march=k8"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox strict"
GENTOO_MIRRORS="http://ftp.du.se/pub/os/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://localhost/gentoo-portage"
USE="amd64 acpi alsa berkdb bitmap-fonts cdr crypt dvd dvdr font-server gif gnome gpm gtk ipv6 jp2 jpeg lzw lzw-tiff mp3 ncurses nls opengl oss pam perl png python readline ssl tcpd tiff truetype truetype-fonts type1-fonts usb userlocales xml2 xpm xrandr xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 2 Alexander Rigbo 2005-04-20 13:00:08 UTC
Never mind my ACCEPT_KEYWORDS btw :-)
Comment 3 Ian Wilder 2005-04-20 13:41:18 UTC
Same here on a stage1 2005.0 install.

livecd portage # emerge --info
Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r3-k8 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r3-k8 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 20 2005, 17:28:18)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-march=k8 -O3 -ffast-math -funroll-all-loops -funit-at-a-time -fpeel-loops -ftracer -funswitch-loops -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O3 -ffast-math -funroll-all-loops -funit-at-a-time -fpeel-loops -ftracer -funswitch-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 S3TC X Xaw3d acpi aim alsa apache2 audiofile authdaemond berkdb bitmap-fonts bonobo bzlib cddb cdinstall cdparanoia cgi chroot crypt curl cyrus dba dbase dga dnd dvd dvdr dvdread emacs encode evo exif faac faad fastcgi fbcon ffmpeg font-server foomaticdb fortran ftp gd gif gimpprint gpm gtk2 gtkhtml imap imlib2 ipv6 java javascript jikes joystick jp2 jpeg jpeg2k kerberos lcms libgda lzw lzw-tiff maildir mbox mdb mime mng moznocompose moznoirc moznomail mozsvg mp3 mpeg mpeg4 mplayer ncurses net nls nptl nvidia openal opengl oss pam perl php png posix python quicktime readline rogue sasl spell ssl svg tcpd theora tiff timidity transcode truetype truetype-fonts type1-fonts unicode usb userlocales v4l v4l2 vhosts videos wmf wxwindows xatrix xine xml2 xpm xrandr xv xvid zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 4 Rob Smith 2005-04-20 14:05:36 UTC
I receive the same error, this is during the emerge system on a fresh stage 1 install.

Here's my emerge info
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.4.21-gss i686)
=================================================================
System uname: 2.4.21-gss i686 Pentium III (Katmai)
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 20 2005, 12:30:53)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.7.9-r1, 1.5, 1.9.5, 1.6.3, 1.4_p6, 1.8.5-r3
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   [Not Present]
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -pipe -mmmx -msse -mfpmath=sse,387 -fomit-frame-pointer -maccumulate-outgoing-args"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -pipe -mmmx -msse -mfpmath=sse,387 -fomit-frame-pointer -maccumulate-outgoing-args"
DISTDIR="/tmp/disfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks parallel-fetch sandbox sfpermsstrict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/tmp/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts avi berkdb bitmap-fonts crypt cups emboss encode foomaticdb fortran gdbm gif gnome gpm gtk gtk2 imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl svga tcpd truetype truetype-fonts type1-fonts xml2 xmms xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

Please note that it affects 1.12-r4, 1.12-r3, and 1.12-r2.

(I masked those three versions, and kbd was no longer going to be built using the emerge system, so I continued the install from there.)
Comment 5 Kevin Jordan 2005-04-20 17:40:35 UTC
I commented out the #ifndef down to the #endif that contains the warnings and it compiles fine.
Comment 6 SpanKY gentoo-dev 2005-04-20 18:59:06 UTC
tim: care to take a look ? :)
Comment 7 Adrian Owen 2005-04-20 21:23:37 UTC
commenting out the stuff in the header file got me a clean compile too.  I am running a 32-bit system. (i686)
Comment 8 Christian Schneider 2005-04-21 02:26:23 UTC
Also got it to work by commenting out the ifndef-block. Hardware is i686 (pentium-m) and I'm using ACCEPT_KEYWORDS="~x86".
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2005-04-21 04:18:19 UTC
*** Bug 89902 has been marked as a duplicate of this bug. ***
Comment 10 Ian Wilder 2005-04-21 09:16:37 UTC
Was also able to emerge by commenting the following out of /usr/include/linux/keyboard.h
//#ifndef __le64
//#ifdef _LINUX_TYPES_H
//#undef _LINUX_TYPES_H
//#warning Gentoo Linux Headers Warning: GNU Libc Linux Headers Override Detect$//#warning Gentoo Linux Headers Warning: This is bad. Removing override and con$//#warning Gentoo Linux Headers Warning: If your compilation dies here, mention$//#warning Gentoo Linux Headers Warning: filing a bug!
//#include <linux/types.h>
//#endif
//#endif
Comment 11 Tim Yamin (RETIRED) gentoo-dev 2005-04-21 11:39:53 UTC
Fixed in CVS, please emerge sync, remerge linux-headers and things should work now - please reopen bug if failures persist. Thanks!
Comment 12 Tim Yamin (RETIRED) gentoo-dev 2005-04-21 13:30:44 UTC
*** Bug 89952 has been marked as a duplicate of this bug. ***
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2005-04-22 03:19:43 UTC
*** Bug 90000 has been marked as a duplicate of this bug. ***
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2005-04-22 03:30:24 UTC
*** Bug 90013 has been marked as a duplicate of this bug. ***
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2005-04-24 06:13:37 UTC
*** Bug 90235 has been marked as a duplicate of this bug. ***
Comment 16 Markus Wernig 2005-05-09 10:42:20 UTC
Hi

I just ran into the same error with linux-headers-2.6.11 on ~x86 (emerge --synced on 2005-05-08, timestamp is 2005-04-21). First while emerging libsdl - worked around there by adding -svga to $USE. Next while emerging aalib - no workaround there but fiddling with keyboard.h (now, _this_ is bad!). It now reads:
#ifndef _LINUX_TYPES_H
//#undef _LINUX_TYPES_H
#warning Gentoo Linux Headers Warning: GNU Libc Linux Headers Override Detected.#warning Gentoo Linux Headers Warning: This is bad. Removing override and continuing.
#warning Gentoo Linux Headers Warning: If your compilation dies here, mention this when
#warning Gentoo Linux Headers Warning: filing a bug!
#include <linux/types.h>
#endif

I mean, WHAT IS THIS CODE DOING THERE ANYWAY?!? What's the point in including types.h twice or even more often? Isnt' this what #define _LINUX_TYPES_H was meant to prevent? And what is such a gentoo extension doing in a - supposedly - vanilla kernel header?!? I don't know why this warning is there, as double-including the same file is definitely an error. But some source files do include various kernel headers (in this case: aalinuxkbd.c includes both <linux/types.h> and <linux/keyboard.h> with keyboard.h having that imho silly switch that will actually FORCE types.h to be re-included!), relying on the preprocessor to filter out those conflicts (one of its duties, isn't it?).

I'm sorry if I'm a nuisance by reopening the bug, but it wasn't there before the last emerge -Duv world. If the version from CVS that's mentioned in the closing message contains the fix, something else has gone awry and it's not being pushed to us humble users.

krgds /markus
Comment 17 SpanKY gentoo-dev 2005-05-09 10:47:24 UTC
here's a tip ... when filing a bug, learn to not be a spaz

if you had read & *understood* the message you would see that the kernel headers are warning about a bug *glibc* introduces and they refuse/dont care to fix

do `emerge sync && emerge linux-headers aalib`

if it still fails, file a NEW bug
Comment 18 Markus Wernig 2005-05-09 15:08:14 UTC
Hi
I'm sorry for annoying the CCs on this bug if they feel annoyed. I've read the warning messages included in keyboard.h. They say that a glibc error has been detected. They determine that by checking #ifdef _LINUX_TYPES_H. This will be set whenever <linux/types.h> has been included before. There appear to be numerous source files that do that (eg. include first types.h and then keyboard.h, which includes types.h). It is by design that this will happen. This is why there is a preprocessor. This software will prevent re-includes, except when it's told not to. What the lines in keyboard.h do is exactly that: prevent the preprocessor from doing its job. If I unset _LINUX_TYPES_H I want to force inclusion of types.h. I would not do that without a reason. And I would want at least some sort of hint as to who the culprit is. Just claiming that it's a "glibc error" without checking where the #include came from and then blowing up the whole compile seems - to say the least - helpless.
So, if someone with more wits than me, and despite of my rant, is still willing to explain to me why this would be a "glibc error" and why the kernel headers should force re-inclusion of already included headers, I would be very grateful and humble. 
In case you determine that including both <linux/types.h> and <linux/keyboard.h> is illegal for a .c source file, I will be happy to file bugs against about half a dozen of packages.

And then, still being a rant, I would ask of you why the compile works without the "gentoo double include addon", i.e. if you leave the file as it was in the original kernel headers, and why it doesn't when enhanced with that less than helpful warning, and what the point of adding those lines was.

krgds /markus

PS: I personally think this is a bug in the gentoo kernel headers. 

PPS: (excuse my ignorance: what's a "spaz"?)
Comment 19 SpanKY gentoo-dev 2005-05-09 15:15:35 UTC
and after all that, you've just shown you still dont know the issue

glibc header files will happily #define _LINUX_TYPES_H without ever actually including linux/types.h and that breaks packages
Comment 20 Markus Wernig 2005-05-09 17:24:20 UTC
Hello
and sorry for the loud pose. I shouldn't be doing this.
I agree that if any .h file defines _LINUX_TYPES_H whithout including types.h, this will certainly break things and is bad. I remember filing a bug against pam where this issue was involved. But my understanding still is that _forcing_ an inclusion will also break things for packages who rely on the correct functioning of prototyping/typedef/... . So it's a tradeoff. And it seems to be more of a political than a technical issue. 
The current solution will work for builds that luckily don't need two related kernel .h's, and for the "bad" glibc .h files. The others will fail. 
But I do understand that you want to ensure _LINUX_TYPES_H is only set if types.h has really been included and not work around it by using some makro that checks for whatever struct.
So a - albeit little pragmatic - approach might be to #define something like _YES_IVE_REALLY_INCLUDED_LINUX_TYPES_H at the end of types.h and check for #ifdef _YES_IVE_REALLY_INCLUDED_LINUX_TYPES_H at the beginning of types.h. So you might be able to keep the problem within types.h and don't need to proliferate it throughout the kernel headers. But then, this does seem bad practice. But it might just work as long as the political issue is unresolved ...

lg /markus
Comment 21 Markus Wernig 2005-05-09 17:59:41 UTC
... plus (reluctantly) keep the current practice of forcing inclusion of types.h
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2005-05-12 23:32:56 UTC
*** Bug 92472 has been marked as a duplicate of this bug. ***
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2005-05-20 00:10:45 UTC
*** Bug 93299 has been marked as a duplicate of this bug. ***
Comment 24 Markus Wernig 2005-05-20 02:04:03 UTC
Could someone give an example of a misbehaving glibc header file? If what vapier
said is true this needs to be fixed within glibc. I still think it's bad to
introduce such a hack into the kernel headers - as many correct builds rely on
this to be working.
Comment 25 Jakub Moc (RETIRED) gentoo-dev 2005-05-22 03:48:10 UTC
*** Bug 93534 has been marked as a duplicate of this bug. ***
Comment 26 kdt3rd 2005-05-22 13:24:10 UTC
Created attachment 59583 [details, diff]
Patch for gentoo kernel header modification of linux-headers

The issue is that I see is that it is invalid to test with the preprocessor for
a typedef'ed type in keyboard.h. The C preprocessor knows nothing about
typedefs, so checking ifndef __le64 is an incorrect check for linux/types.h

For example:

#include <stdio.h>
typedef int foobar;
int main( int argc, const char *argv[] )
{
#ifdef foobar
    printf( "Hello, world!\n" );
#else
    printf( "Goodbye cruel world.\n" );
#endif
    return 0;
}

Will print "Goodbye cruel world.", because foobar is NOT defined as far as the
preprocessor is concerned.

A (slightly) better check for this is to check for ifndef __bitwise which is
just above the typedef for __le64:

(in /usr/include/linux/keyboard.h)
#ifndef __bitwise
instead of
#ifndef __le64

- Kimball
Comment 27 Jakub Moc (RETIRED) gentoo-dev 2005-05-25 07:10:58 UTC
*** Bug 93940 has been marked as a duplicate of this bug. ***
Comment 28 Jakub Moc (RETIRED) gentoo-dev 2005-05-27 02:50:37 UTC
*** Bug 94157 has been marked as a duplicate of this bug. ***
Comment 29 Jakub Moc (RETIRED) gentoo-dev 2005-08-25 02:10:38 UTC
*** Bug 103671 has been marked as a duplicate of this bug. ***
Comment 30 Jakub Moc (RETIRED) gentoo-dev 2005-12-26 13:51:07 UTC
*** Bug 116808 has been marked as a duplicate of this bug. ***
Comment 31 Jakub Moc (RETIRED) gentoo-dev 2006-07-01 00:00:18 UTC
*** Bug 138659 has been marked as a duplicate of this bug. ***