linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Michal Marek <mmarek@suse.cz>,
	linux-kbuild <linux-kbuild@vger.kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	David Herrmann <dh.herrmann@googlemail.com>,
	Jiri Kosina <jkosina@suse.cz>, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH 3/6] samples: use uapiprogs support for seccomp
Date: Sun, 13 Jul 2014 20:42:51 +0200	[thread overview]
Message-ID: <1405276974-17323-3-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <1405276974-17323-1-git-send-email-sam@ravnborg.org>

Reduce complexity of seccomp Makefile by introducing use of uapiprogs support.
Build testet with i686 only.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 samples/Makefile         |  2 +-
 samples/seccomp/Makefile | 48 ++----------------------------------------------
 2 files changed, 3 insertions(+), 47 deletions(-)

diff --git a/samples/Makefile b/samples/Makefile
index 7c08028..b4d7d66 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -11,5 +11,5 @@ obj-$(CONFIG_SAMPLES) += rpmsg/
 obj-$(CONFIG_SAMPLES) += kdb/
 
 # user space programs
-obj-$(CONFIG_SAMPLES) += seccomp/
+subdir-$(CONFIG_SAMPLES) += seccomp
 obj-$(CONFIG_SAMPLES) += hidraw/
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index 1b4e4b8..8f11cf4 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -1,48 +1,4 @@
-# kbuild trick to avoid linker error. Can be omitted if a module is built.
-obj- := dummy.o
+uapiprogs-$(CONFIG_SECCOMP_FILTER) := bpf-fancy dropper bpf-direct
 
-hostprogs-$(CONFIG_SECCOMP_FILTER) := bpf-fancy dropper bpf-direct
+bpf-fancy-y := bpf-fancy.o bpf-helper.o
 
-HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
-HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include
-HOSTCFLAGS_bpf-helper.o += -I$(objtree)/usr/include
-HOSTCFLAGS_bpf-helper.o += -idirafter $(objtree)/include
-bpf-fancy-objs := bpf-fancy.o bpf-helper.o
-
-HOSTCFLAGS_dropper.o += -I$(objtree)/usr/include
-HOSTCFLAGS_dropper.o += -idirafter $(objtree)/include
-dropper-objs := dropper.o
-
-HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include
-HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
-bpf-direct-objs := bpf-direct.o
-
-# Try to match the kernel target.
-ifndef CROSS_COMPILE
-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
-always := $(hostprogs-y)
-else
-# MIPS system calls are defined based on the -mabi that is passed
-# to the toolchain which may or may not be a valid option
-# for the host toolchain. So disable tests if target architecture
-# is MIPS but the host isn't.
-ifndef CONFIG_MIPS
-always := $(hostprogs-y)
-endif
-endif
-- 
1.9.3


  parent reply	other threads:[~2014-07-13 18:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13 18:36 [PATCH v2 0/6] kbuild: use target compiler for user binaries in samples/ Sam Ravnborg
2014-07-13 18:42 ` [PATCH 1/6] kbuild: add support for building userspace api programs Sam Ravnborg
2014-07-13 18:42   ` [PATCH 2/6] samples: refactor Makefile Sam Ravnborg
2014-07-13 19:25     ` Randy Dunlap
2014-07-13 19:52       ` Sam Ravnborg
2014-07-13 20:13         ` Randy Dunlap
2014-07-14  0:26         ` Stephen Rothwell
2014-07-13 18:42   ` Sam Ravnborg [this message]
2014-07-16  9:43     ` [PATCH 3/6] samples: use uapiprogs support for seccomp Masahiro Yamada
2014-07-16 10:31       ` Sam Ravnborg
2014-07-17  3:40         ` Masahiro Yamada
2014-07-13 18:42   ` [PATCH 4/6] samples: use uapiprogs support for hidraw Sam Ravnborg
2014-07-13 18:42   ` [PATCH 5/6] samples: fix warnings in uhid-example Sam Ravnborg
2014-07-13 18:42   ` [PATCH 6/6] samples: use uapiprogs support for uhid Sam Ravnborg
2014-07-13 19:23   ` [PATCH 1/6] kbuild: add support for building userspace api programs Randy Dunlap
2014-07-13 19:53     ` Sam Ravnborg
2014-07-14  0:29 ` [PATCH v2 0/6] kbuild: use target compiler for user binaries in samples/ Stephen Rothwell
2014-07-14  0:33   ` Stephen Rothwell
2014-07-17 15:22     ` Michal Marek
2014-08-21 13:46       ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405276974-17323-3-git-send-email-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=dh.herrmann@googlemail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sfr@canb.auug.org.au \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).