diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-02-04 17:28:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-05 04:38:49 -0500 |
commit | 275aaa68334c45f616c6576f20201e9890c5da18 (patch) | |
tree | a00b6a37ccdc823567a0a1ae414b7275c33167b6 /samples/seccomp | |
parent | 326b1ffc136d944d403a2b44dc3abace2a4e10fd (diff) |
samples/seccomp: be less stupid about cross compiling
The seccomp filters are currently built for the build host, not for the
machine that they are going to run on, but they are also built for with
the -m32 flag if the kernel is built for a 32 bit machine, both of which
seems rather odd.
It broke allyesconfig on my machine, which is x86-64, but building for
32 bit ARM, with this error message:
In file included from /usr/include/stdio.h:28:0,
from samples/seccomp/bpf-fancy.c:15:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
because there are no 32 bit libc headers installed on this machine. We
should really be building all the samples for the target machine rather
than the build host, but since the infrastructure for that appears to be
missing right now, let's be a little bit smarter and not pass the '-m32'
flag to the HOSTCC when cross- compiling.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: James Morris <james.l.morris@oracle.com>
Acked-by: Will Drewry <wad@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'samples/seccomp')
-rw-r--r-- | samples/seccomp/Makefile | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile index bbbd276659ba..7203e66dcd6f 100644 --- a/samples/seccomp/Makefile +++ b/samples/seccomp/Makefile | |||
@@ -19,6 +19,7 @@ bpf-direct-objs := bpf-direct.o | |||
19 | 19 | ||
20 | # Try to match the kernel target. | 20 | # Try to match the kernel target. |
21 | ifndef CONFIG_64BIT | 21 | ifndef CONFIG_64BIT |
22 | ifndef CROSS_COMPILE | ||
22 | 23 | ||
23 | # s390 has -m31 flag to build 31 bit binaries | 24 | # s390 has -m31 flag to build 31 bit binaries |
24 | ifndef CONFIG_S390 | 25 | ifndef CONFIG_S390 |
@@ -35,6 +36,7 @@ HOSTLOADLIBES_bpf-direct += $(MFLAG) | |||
35 | HOSTLOADLIBES_bpf-fancy += $(MFLAG) | 36 | HOSTLOADLIBES_bpf-fancy += $(MFLAG) |
36 | HOSTLOADLIBES_dropper += $(MFLAG) | 37 | HOSTLOADLIBES_dropper += $(MFLAG) |
37 | endif | 38 | endif |
39 | endif | ||
38 | 40 | ||
39 | # Tell kbuild to always build the programs | 41 | # Tell kbuild to always build the programs |
40 | always := $(hostprogs-y) | 42 | always := $(hostprogs-y) |