DIRS+=box
PROGS+=$(o)/box/box
-BOX_CFLAGS=-m64 -DCONFIG_BOX_KERNEL_AMD64 #-DCONFIG_BOX_USER_AMD64
+BOX_CFLAGS=
+ifdef CONFIG_BOX_KERNEL_AMD64
+BOX_CFLAGS += -m64
+endif
$(o)/box/box: $(o)/box/box.o
$(o)/box/box.o: $(o)/box/syscall-table.h
$(o)/box/box.o: CFLAGS+=$(BOX_CFLAGS)
$(o)/box/syscall-table.h: $(s)/box/mk-syscall-table
- sh $^ >$@ $(BOX_CFLAGS)
+ sh $^ >$@ $(CFLAGS) $(BOX_CFLAGS)
box-tests: $(addprefix $(o)/box/test-sys,32-int80 64-int80 32-syscall 64-syscall 32-sysenter 64-sysenter)
#define _LARGEFILE64_SOURCE
#define _GNU_SOURCE
+#include "autoconf.h"
+
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
echo '/* Syscall table automatically generated by mk-syscall-table */'
echo
cat <<FOE |
+#include "autoconf.h"
#if defined(CONFIG_BOX_KERNEL_AMD64) && !defined(CONFIG_BOX_USER_AMD64)
#include <asm/unistd_32.h>
#else
# Build MO-P contest environment
Set("CONFIG_MOP" => 1);
+# If you are running a 64-bit Linux kernel, you need to build a 64-bit
+# sandbox and decide whether your userspace is 32- or 64-bit.
+Set("CONFIG_BOX_KERNEL_AMD64" => 1);
+#Set("CONFIG_BOX_USER_AMD64" => 1);
+
# Settings of libucw
UnSet("CONFIG_SHARED");
UnSet("CONFIG_UCW_THREADS");