1

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?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
cat
  • 3,428
  • 4
  • 22
  • 50

1 Answers1

2

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.

vonbrand
  • 18,156
  • 2
  • 37
  • 59
  • [I know about binfmt](http://unix.stackexchange.com/questions/259376/how-is-mono-magical) :P I stumbled upon [Gilles' comment](http://unix.stackexchange.com/questions/47495/oldest-binary-working-on-linux#comment66069_47495) on [Oldest binary working on Linux?](http://unix.stackexchange.com/q/47495/136107), and decided to test it out. – cat Mar 21 '16 at 19:24
  • @tac, that is a *native* binary, iBCS was for running *SCO* binaries. – vonbrand Mar 21 '16 at 19:31
  • I'm aware, I just thought I might point out where the idea appeared to me to use IBCS. – cat Mar 21 '16 at 19:32