I'm trying to build IBCS (source here) on Ubuntu 15.10 (Linux 4.2.35).
This module is obviously pretty old, because its CONFIG.i386
file gives gcc
an option -m486
, which doesn't exist anymore, but changing to -march=native
seems to work OK.
The file emulate.c
contains #includes
like:
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <asm/uaccess.h>
On my system, only linux/version.h
exists. The following seems to work, however:
#include "/usr/include/valgrind/config.h"
#include "/usr/include/sepol/module.h"
#include <linux/version.h>
#include </usr/src/linux-headers-4.2.0-35/include/linux/uaccess.h>
(YMMV, of course, if you don't have sepol
.)
That works, except for /usr/src/linux-headers-4.2.0-35/include/linux/uaccess.h
, the top of which has
#include <asm/uaccess.h>
Which is not found.
I don't seem to have an asm
folder in /usr/include
or /usr/include/linux
. I do have an /usr/include/asm_generic
, but it doesn't have uaccess.h
.
My questions are:
Why do the modern kernel headers contain references to (apparently) nonexistent files, rather than providing them itself?
Where can I get a version of
asm/uaccess.h
and the other headers needed for compilation?
-I /lib/modules/$(uname -r)/build/arch/x86/include
to the compiler command line.