public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [RFC][PATCH] Add cpu architecrute check
Date: Thu, 04 Jun 2009 16:23:17 +0900	[thread overview]
Message-ID: <4A277665.1080402@renesas.com> (raw)

Some system call test program depends cpu architecture.
We cannot compile these, and there is a case to fail in a test even if
We compile it.
This check cpu architecture and build check in Makefile.
This didn't check all syscall and test cases.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
---
 Makefile                                           |   10 +++++++++-
 testcases/kernel/syscalls/fallocate/Makefile       |    6 ++++++
 testcases/kernel/syscalls/set_thread_area/Makefile |    6 ++++++
 testcases/kernel/syscalls/sgetmask/Makefile        |    6 ++++++
 4 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 4cf124b..5243290 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,13 @@
 # See toplevel INSTALL for build info

+ifndef ARCH
+# copy from Makefile in linux kernel
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+	-e s/arm.*/arm/ -e s/sa110/arm/ \
+	-e s/s390x/s390/ -e s/parisc64/parisc/ \
+	-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+	-e s/sh[234].*/sh/ )
+endif
 ifdef CROSS_COMPILE
 CROSS_COMPILER = $(CROSS_COMPILE)
 endif
@@ -12,7 +20,7 @@ endif
 HAS_NUMA=$(shell sh tools/scripts/numa_test.sh)

 export CFLAGS += -Wall $(CROSS_CFLAGS)
-export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA
+export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA ARCH

 -include config.mk

diff --git a/testcases/kernel/syscalls/fallocate/Makefile b/testcases/kernel/syscalls/fallocate/Makefile
index d6016be..e16c722 100644
--- a/testcases/kernel/syscalls/fallocate/Makefile
+++ b/testcases/kernel/syscalls/fallocate/Makefile
@@ -20,8 +20,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp

+# This system call is suported in i386, x86_64 and ppc only.
+ifneq (,$(findstring $(ARCH), i386 x86_64 ppc))
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
+else
+SRCS    =
+TARGETS =
+endif

 all: $(TARGETS)

diff --git a/testcases/kernel/syscalls/set_thread_area/Makefile b/testcases/kernel/syscalls/set_thread_area/Makefile
index b5289a9..6342839 100644
--- a/testcases/kernel/syscalls/set_thread_area/Makefile
+++ b/testcases/kernel/syscalls/set_thread_area/Makefile
@@ -19,8 +19,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp

+# This system call is supported in i386 and x86_64 only.
+ifneq (,$(findstring $(ARCH), i386 x86_64))
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
+else
+SRCS    =
+TARGETS =
+endif

 all: $(TARGETS)

diff --git a/testcases/kernel/syscalls/sgetmask/Makefile b/testcases/kernel/syscalls/sgetmask/Makefile
index b5289a9..f684be8 100644
--- a/testcases/kernel/syscalls/sgetmask/Makefile
+++ b/testcases/kernel/syscalls/sgetmask/Makefile
@@ -19,8 +19,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp

+# This system call does not support x86_64.
+ifeq (,$(findstring $(ARCH),x86_64))
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
+else
+SRCS    =
+TARGETS =
+endif

 all: $(TARGETS)

-- 
1.6.3.1


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2009-06-04  7:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04  7:23 Nobuhiro Iwamatsu [this message]
2009-06-04  8:18 ` [LTP] [RFC][PATCH] Add cpu architecrute check Mike Frysinger
2009-06-05  0:41   ` Nobuhiro Iwamatsu

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=4A277665.1080402@renesas.com \
    --to=iwamatsu.nobuhiro@renesas.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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