ALT Linux Bugzilla – #5409
linux/byteorder/*_endian.h cannot be used outside kernel builds
Last modified: 2006-10-10 20:16:03
You need to
before you can comment on or make changes to this bug.
Some user-space software, e.g. gnome-vfs, need both glibc headers and kernel
headers for compilation. With kernel headers of version 2.6.9, however,
inclusion of many kernel headers, for instance, linux/cdrom.h, leads to
inclusion of linux/byteorder/*_endian.h. These headers declare functions using
types that are hidden when the features.h header from glibc is included. The
attached testcase illustrates the problem.
To amend this, the conflicting declarations should be disabled when __KERNEL__
macro is not defined. The patch is underway.
Steps to Reproduce:
Try compiling the attached C source file.
Compilation should succeed.
Created an attachment (id=621) [details]
The testcase C source file
Created an attachment (id=622) [details]
This patch has been tested against:
the testcase above;
Any chance it goes upstream?
The patch in question also breaks build:
$ rpmbuild -bc hdparm.spec
hdparm.c:1315: warning: implicit declaration of function '__le16_to_cpus'
hdparm.c:1315: warning: nested extern declaration of '__le16_to_cpus'
cc -o hdparm hdparm.o identify.o
hdparm.o: In function `process_dev':
hdparm.c:(.text+0x1a4f): undefined reference to `__le16_to_cpus'
hdparm.o: In function `main':
hdparm.c:(.text+0x3791): undefined reference to `__le16_to_cpus'
collect2: ld returned 1 exit status
make: *** [hdparm] Error 1
Broken patch removed in std26-2.6.16-alt11; let's see what breaks without it...