asm/atomic.h #includes non-existant header file, asm/processor.h

Bug #65014 reported by Dave Barry on 2006-10-10
8
Affects Status Importance Assigned to Milestone
linux-source-2.6.17 (Ubuntu)
Undecided
Unassigned

Bug Description

It seems that asm/processor.h is missing from linux-libc-dev.

Compiling the following reproduces the issue on i386 (and likely x64)

-->8--
#include <asm/atomic.h>

int main() { return 0; }
-->8--

kryshaam (kryshaam) wrote :

I have the same problem ... and I need this file ;)

Matthew Woerly (nattgew) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you in the latest kernel in Hardy? Thanks in advance.

Jean-Baptiste Lallement (jibel) wrote :

Headers provided by linux-libc-dev are not meant to be used to build third-party modules for your kernel. You'd better use linux-headers-* packages for that.

Did you install linux-headers-* from the kernel you want built your software for ?

Don't forget to use -I and -L option of gcc (if this is the compiler you're using) to set include and library path.

Changed in linux-source-2.6.17:
status: New → Incomplete
Dave Barry (dave-psax) wrote :

The problem when I reported this bug had nothing to do with kernel modules, as indicated by the snippet that reproduces the problem. /usr/include/asm/atomic.h was provided by the linux-libc-dev package. When you included this header file, breakage ensued.

In hardy, this file no longer exists (and this is likely the correct "solution"). By this time of course, I have rolled my own atomicity anyway, I suspect the real issue here is that kernel headers were leaking to userspace.

Jean-Baptiste Lallement (jibel) wrote :

Hi Dave,

I've used the word "Module" because the <asm/atomic.h> and <asm/bitops.h> header files were not designed for use in userspace, and would fail to compile on some architectures while silently giving non-atomic behavior on others. The C compiler provides its own atomic built-in functions that are suitable for use in userspace programs instead.

You can refer to discussion on lklm at http://marc.info/?l=linux-kernel&m=115299997829268&w=2

I'm changing status to 'Invalid' because those headers won't be back in linux-libc-dev

Thanks again for your time and don't hesitate to submit bug reports in the future.

Changed in linux-source-2.6.17:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers