Compiling code that uses kernel headers

Peter Robinson pbrobinson at gmail.com
Fri Jan 7 09:28:52 UTC 2005


> I am working with the libpcap + ringbuffer and trying to get it moved
> from Debian to Red Hat. The Debian/Slackware code depends upon
> /usr/include/linux/system.h which has the kernel version of asm.h
> linked to if for the platform. For i386 this is asm-i386.h which has
> the macro mb(); that the pcap ringbuffer code relies on to make sure
> some obscure race conditions are taken of. [I do not know what the
> race condition is beyond it talking to the kernel half of the
> ringbuffer.]
> 
> Anyway it compiles well on the other Linux versions we have because it
> can find the call to mb() without problems. On Fecore Core 3 (and most
> likely RHEL4) it does not work at all because  of kernel system.h now
> in /lib/modules/....
> 
> What is the best way of dealing with items like this?

There is an bugzilla item filed under devel for the glibc-kernheaders
package with a request to update them from 2.4 to 2.6 headers. There
are a number of packages that have issues with compiling using the 2.4
headers, especially things that rely on new features like v4l2 etc.

To work around it I've justsym linked /usr/include/linux to the
/lib/modules/... directory. Not sure if this is the right way or will
cause any problems but its seems to be working allright to date.

Pete




More information about the devel mailing list