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:

  1. Why do the modern kernel headers contain references to (apparently) nonexistent files, rather than providing them itself?

  2. Where can I get a version of asm/uaccess.h and the other headers needed for compilation?

  • 2
    Try adding -I /lib/modules/$(uname -r)/build/arch/x86/include to the compiler command line. – Mark Plotnick Mar 21 '16 at 17:41
  • @MarkPlotnick Oh, that's worked. – cat Mar 21 '16 at 17:54

iBCS is obsolete, has been for a long time. Too much has changed in the Linux innards to there be any chance for this to still compile, even on an early 4.x kernel. Today it is linux-abi, but that is dead since 2013. Perhaps one of the binfmt modules does the job today.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.