* [LTP] [RFC][PATCH] Add cpu architecrute check
@ 2009-06-04 7:23 Nobuhiro Iwamatsu
2009-06-04 8:18 ` Mike Frysinger
0 siblings, 1 reply; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2009-06-04 7:23 UTC (permalink / raw)
To: ltp-list
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [RFC][PATCH] Add cpu architecrute check
2009-06-04 7:23 [LTP] [RFC][PATCH] Add cpu architecrute check Nobuhiro Iwamatsu
@ 2009-06-04 8:18 ` Mike Frysinger
2009-06-05 0:41 ` Nobuhiro Iwamatsu
0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2009-06-04 8:18 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1.1: Type: text/plain, Size: 846 bytes --]
On Thursday 04 June 2009 03:23:17 Nobuhiro Iwamatsu wrote:
> --- a/Makefile
> +++ b/Makefile
> +ifndef ARCH
> +# copy from Makefile in linux kernel
> +ARCH := $(shell uname -m
executing uname to detect build/target systems is never acceptable.
> --- 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
atm, better to put the ifdef logic into the test itself. look at some of the
other tests that get stubbed out in the syscalls dir.
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 408 bytes --]
------------------------------------------------------------------------------
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
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [RFC][PATCH] Add cpu architecrute check
2009-06-04 8:18 ` Mike Frysinger
@ 2009-06-05 0:41 ` Nobuhiro Iwamatsu
0 siblings, 0 replies; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2009-06-05 0:41 UTC (permalink / raw)
To: Mike Frysinger; +Cc: ltp-list
Hi,
Mike Frysinger wrote:
> On Thursday 04 June 2009 03:23:17 Nobuhiro Iwamatsu wrote:
>> --- a/Makefile
>> +++ b/Makefile
>> +ifndef ARCH
>> +# copy from Makefile in linux kernel
>> +ARCH := $(shell uname -m
>
> executing uname to detect build/target systems is never acceptable.
I see.
>
>> --- 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
>
> atm, better to put the ifdef logic into the test itself. look at some of the
> other tests that get stubbed out in the syscalls dir.
I see, again.
I check your point and Subrata's patch.
Thank you.
Best regards,
Nobuhiro
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-05 0:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 7:23 [LTP] [RFC][PATCH] Add cpu architecrute check Nobuhiro Iwamatsu
2009-06-04 8:18 ` Mike Frysinger
2009-06-05 0:41 ` Nobuhiro Iwamatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox