LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-31-2005, 09:17 AM   #1
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Rep: Reputation: 15
Is this a kernel-headers bug?


I grabbed Xorg's 7.X beta-1. Got as far as xorg-server when something like the following appeared:

Code:
/usr/include/linux/agpart.h: 55: parse error before __u16
/usr/include/linux/agpart.h: 61: parse error before __u32
Naturaly, I assumed its a problem with Xorg7, especially being Beta! However, looking at the file that was giving the problem xorg-server-*/hw/xfree86/os-support/linux/lnx_agp.c, where the following was declared:
Code:
struct _agp_info agpinf;
I could not find anything wrong here, so I looked into the <linux/agpart.h> file. Nothing seemed wrong here. Further searching I found myself inside <linux/types.h> where __u16 and __u32 are declared. And found that I had to go to <stdint.h> to find where u_int16_t and u_int32_t are defined.

I found those simply mean: unsigned short int for 16-bit unsigned integer, and the unsigned int for the 32-bit unsigned integer.

I then changed all occurances of __u16 to unsigned short int and __u32 to unsigned int in /usr/include/linux/agpart.h.

I tried make again under the xorg-server tree, and this time it went through without any errors.

The following Defines seem to be of possible importance:
__int8_t_defined from <stdint.h>
__KERNEL_STRICT_NAMES from <linux/types.h>
__BIT_TYPES_DEFINED__ from <linux/types.h>

I also noticed that __u16 and __u32 are declared twice in this file. Once under the __BIT_TYPES_DEFINED__ and then a second time immediately under the endif of __BIT_TYPES_DEFINED__, and __BIT_TYPES_DEFINED__ has no #else declared.

The __BIT_TYPES_DEFINED__ declares __u16 and __u32 to different typedefs that can be found in <sys/types.h>, which end up being the same structure as those in <stdint.h>

What is going on here?
Does Xorg have to include a certain #define?

Almost forgot, kernel version: 2.6.13.4

- Kevin Day
 
Old 11-01-2005, 10:00 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
i would say yes this is an error in kernel headers (Linux-Libc-Headers)
these types of errors don't happen that often but it is a matter of one header being dependant on another
and not getting called in the right order.
Most of the includes use #define constants to fix this type of thing and often with this type of stuff people will just find an easy workaround like you did and move on which i think may actually slow the process of fixing these type of bugs.
since it's not ok to upgrade libc headers you are kind of stuck with them and just working around the problems but most likely this stuff is fixed in the newer versions.
 
Old 11-05-2005, 03:10 PM   #3
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Original Poster
Rep: Reputation: 15
thanks for clearing that up.

This had me wondering for some time now.

edit: That given kernel-headers was version 2.6.12.0.
This makes me worry as it is older than the kernel being used, but no new kernel-headers above this version has been release yet.

Last edited by Yerp; 11-05-2005 at 03:14 PM.
 
Old 11-05-2005, 04:32 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
it's extreemly important the user space glibc headers (kernel headers in /usr/include) remain the headers used to actually compile glibc. what we do is use the actual headers from the kernel to compile glibc then change the headers to the cleaned up Linux-Libc-Headers of the same version number so internel kernel junk is not exposed. Then when you upgrade the kernel you should leave the userspace headers alone. Suposedly the syscall API will not change so the new kernels will be backward compatable with your glibc.

If you have changed the Linux-Libc-Headers to a version higher than you started out with you should change back.

We used to upgrade the headers along with the kernel years ago and it would lead to degraded performance and stability as new programs were compiled against headers that did not match the userspace symbols in glibc. Linus had to explain at us about that one.

I personally think the headers should to be maintaned by glibc so people stopped thinking of them as kernel headers altogother. they are afterall the headers to glibc and not the kernel.

Last edited by foo_bar_foo; 11-05-2005 at 04:34 PM.
 
Old 11-06-2005, 10:27 AM   #5
Yerp
Member
 
Registered: Jun 2004
Distribution: Turtle Kevux 0.8.8
Posts: 129

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by foo_bar_foo

I personally think the headers should to be maintaned by glibc so people stopped thinking of them as kernel headers altogother. they are afterall the headers to glibc and not the kernel. [/B]
I am on an LFS or HLFS style system, so I generally unroll the system myself. Putting them into glibc seem to me not such a good idea, as there are numerous other libc's out there (for better or worse..).

Fact is, I am using a uClibc system so I can squeeze the 2-gig glibc system into a 500mb uclibc system, without compression. (and i did)

As a result of using uClibc, I have a lot of wild-cards to worry about when I have problems as it could be uClibc itself, which lead to the question made by this post.

Quote:
Originally posted by foo_bar_foo

it's extreemly important the user space glibc headers (kernel headers in /usr/include) remain the headers used to actually compile glibc.[/B]
And don't worry, I upgrade my linux-libc-headers only when compiling my system libc.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to find/install kernel-source or kernel-headers timsch75 Slackware 3 10-22-2005 09:17 AM
Difference between kernel-headers kernel-source twinkers Debian 2 06-18-2005 11:20 AM
send packets with kernel routing and without kernel messing with headers bassdemon Programming 5 02-08-2005 06:29 PM
Kernel headers mmm Linux - General 3 07-13-2003 03:38 PM
Kernel Headers?? justiceisblind Linux - Newbie 1 02-24-2002 12:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration