linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] samples/seccomp: fix 31 bit build on s390
@ 2012-09-08  8:31 Heiko Carstens
  2012-09-10 15:13 ` Kees Cook
  2012-09-12  2:56 ` James Morris
  0 siblings, 2 replies; 3+ messages in thread
From: Heiko Carstens @ 2012-09-08  8:31 UTC (permalink / raw)
  To: James Morris; +Cc: Kees Cook, linux-kernel

>From cea999ef4e68e23c70e64baf054768bdebe15e1b Mon Sep 17 00:00:00 2001
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Date: Sat, 8 Sep 2012 10:23:42 +0200
Subject: [PATCH] samples/seccomp: fix 31 bit build on s390

On s390 the flag to force 31 builds is -m31 instead of -m32 unlike
on all (?) other architectures.

Fixes this compile error:

  HOSTCC  samples/seccomp/bpf-direct.o
cc1: error: unrecognized command line option "-m32"
make[2]: *** [samples/seccomp/bpf-direct.o] Error 1

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

Patch is on top of linux-next of today.

 samples/seccomp/Makefile | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index 16aa2d4..bbbd276 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -18,14 +18,22 @@ HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
 bpf-direct-objs := bpf-direct.o
 
 # Try to match the kernel target.
-ifeq ($(CONFIG_64BIT),)
-HOSTCFLAGS_bpf-direct.o += -m32
-HOSTCFLAGS_dropper.o += -m32
-HOSTCFLAGS_bpf-helper.o += -m32
-HOSTCFLAGS_bpf-fancy.o += -m32
-HOSTLOADLIBES_bpf-direct += -m32
-HOSTLOADLIBES_bpf-fancy += -m32
-HOSTLOADLIBES_dropper += -m32
+ifndef CONFIG_64BIT
+
+# s390 has -m31 flag to build 31 bit binaries
+ifndef CONFIG_S390
+MFLAG = -m32
+else
+MFLAG = -m31
+endif
+
+HOSTCFLAGS_bpf-direct.o += $(MFLAG)
+HOSTCFLAGS_dropper.o += $(MFLAG)
+HOSTCFLAGS_bpf-helper.o += $(MFLAG)
+HOSTCFLAGS_bpf-fancy.o += $(MFLAG)
+HOSTLOADLIBES_bpf-direct += $(MFLAG)
+HOSTLOADLIBES_bpf-fancy += $(MFLAG)
+HOSTLOADLIBES_dropper += $(MFLAG)
 endif
 
 # Tell kbuild to always build the programs
-- 
1.7.11.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] samples/seccomp: fix 31 bit build on s390
  2012-09-08  8:31 [PATCH] samples/seccomp: fix 31 bit build on s390 Heiko Carstens
@ 2012-09-10 15:13 ` Kees Cook
  2012-09-12  2:56 ` James Morris
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2012-09-10 15:13 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: James Morris, linux-kernel, Will Drewry

On Sat, Sep 8, 2012 at 1:31 AM, Heiko Carstens
<heiko.carstens@de.ibm.com> wrote:
> On s390 the flag to force 31 builds is -m31 instead of -m32 unlike
> on all (?) other architectures.
>
> Fixes this compile error:
>
>   HOSTCC  samples/seccomp/bpf-direct.o
> cc1: error: unrecognized command line option "-m32"
> make[2]: *** [samples/seccomp/bpf-direct.o] Error 1
>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Thanks for the catch!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] samples/seccomp: fix 31 bit build on s390
  2012-09-08  8:31 [PATCH] samples/seccomp: fix 31 bit build on s390 Heiko Carstens
  2012-09-10 15:13 ` Kees Cook
@ 2012-09-12  2:56 ` James Morris
  1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2012-09-12  2:56 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: James Morris, Kees Cook, linux-kernel

On Sat, 8 Sep 2012, Heiko Carstens wrote:

> >From cea999ef4e68e23c70e64baf054768bdebe15e1b Mon Sep 17 00:00:00 2001
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> Date: Sat, 8 Sep 2012 10:23:42 +0200
> Subject: [PATCH] samples/seccomp: fix 31 bit build on s390
> 
> On s390 the flag to force 31 builds is -m31 instead of -m32 unlike
> on all (?) other architectures.
> 
> Fixes this compile error:
> 
>   HOSTCC  samples/seccomp/bpf-direct.o
> cc1: error: unrecognized command line option "-m32"
> make[2]: *** [samples/seccomp/bpf-direct.o] Error 1
> 
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-12  3:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-08  8:31 [PATCH] samples/seccomp: fix 31 bit build on s390 Heiko Carstens
2012-09-10 15:13 ` Kees Cook
2012-09-12  2:56 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).