mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: <linux-kernel@vger.kernel.org>
Cc: shuahkh@osg.samsung.com, Andrew Morton <akpm@osdl.org>,
	gorcunov@openvz.org, Arnd Bergmann <arnd@arndb.de>,
	cov@codeaurora.org
Subject: [PATCH 3/3] selftests/kcmp: Always try to build the test
Date: Tue,  2 Dec 2014 16:52:08 +1100	[thread overview]
Message-ID: <1417499528-23377-3-git-send-email-mpe@ellerman.id.au> (raw)
In-Reply-To: <1417499528-23377-1-git-send-email-mpe@ellerman.id.au>

Don't prevent the test building on non-x86. Just try and build it and
let the chips fall where they may.

Add support for CROSS_COMPILE while we're at it. Also we don't need a
custom rule for building kcmp_test.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---

eg:
$ uname -m
x86_64
$ make ARCH=powerpc headers_install
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  ...
  INSTALL usr/include/asm/ (43 files)
$ cd tools/testing/selftests/kcmp/
$ make
ppc64-cc -I../../../../usr/include/    kcmp_test.c   -o kcmp_test
$ file kcmp_test
kcmp_test: ELF 32-bit MSB  executable, PowerPC or cisco 4500 ...


 tools/testing/selftests/kcmp/Makefile | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
index 4f00c0524501..ff0eefdc6ceb 100644
--- a/tools/testing/selftests/kcmp/Makefile
+++ b/tools/testing/selftests/kcmp/Makefile
@@ -1,21 +1,7 @@
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
-ifeq ($(ARCH),i386)
-        ARCH := x86
-	CFLAGS := -DCONFIG_X86_32 -D__i386__
-endif
-ifeq ($(ARCH),x86_64)
-	ARCH := x86
-	CFLAGS := -DCONFIG_X86_64 -D__x86_64__
-endif
+CC := $(CROSS_COMPILE)$(CC)
 CFLAGS += -I../../../../usr/include/
 
-all:
-ifeq ($(ARCH),x86)
-	gcc $(CFLAGS) kcmp_test.c -o kcmp_test
-else
-	echo "Not an x86 target, can't build kcmp selftest"
-endif
+all: kcmp_test
 
 run_tests: all
 	@./kcmp_test || echo "kcmp_test: [FAIL]"
-- 
1.9.1


  parent reply	other threads:[~2014-12-02  5:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02  5:52 [PATCH 1/3] kcmp: Move kcmp.h into uapi Michael Ellerman
2014-12-02  5:52 ` [PATCH 2/3] selftests/kcmp: Don't include kernel headers Michael Ellerman
2014-12-02  5:52 ` Michael Ellerman [this message]
2014-12-02 16:20   ` [PATCH 3/3] selftests/kcmp: Always try to build the test Christopher Covington
2014-12-02 20:59     ` Shuah Khan
  -- strict thread matches above, loose matches on Subject: below --
2014-10-23  5:07 [PATCH 1/3] kcmp: Move kcmp.h into uapi Michael Ellerman
2014-10-23  5:07 ` [PATCH 3/3] selftests/kcmp: Always try to build the test Michael Ellerman
2014-10-23  6:09   ` Cyrill Gorcunov
2014-12-02  5:53     ` Michael Ellerman
2014-10-23 13:06   ` Christopher Covington
2014-10-23 13:52     ` Shuah Khan
2014-12-01 16:58       ` Shuah Khan
2014-12-02  5:44     ` Michael Ellerman

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=1417499528-23377-3-git-send-email-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=akpm@osdl.org \
    --cc=arnd@arndb.de \
    --cc=cov@codeaurora.org \
    --cc=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shuahkh@osg.samsung.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

all inboxes | Powered by JetHome®