* [PATCH 1/3] kcmp: Move kcmp.h into uapi
@ 2014-12-02 5:52 Michael Ellerman
2014-12-02 5:52 ` [PATCH 2/3] selftests/kcmp: Don't include kernel headers Michael Ellerman
2014-12-02 5:52 ` [PATCH 3/3] selftests/kcmp: Always try to build the test Michael Ellerman
0 siblings, 2 replies; 12+ messages in thread
From: Michael Ellerman @ 2014-12-02 5:52 UTC (permalink / raw)
To: linux-kernel; +Cc: shuahkh, Andrew Morton, gorcunov, Arnd Bergmann, cov
kcmp.h appears to be part of the API, it's documented in kcmp(2), and
the selftests/kcmp code uses it. So move it to uapi so it's actually
exported.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
include/linux/kcmp.h | 17 -----------------
include/uapi/linux/Kbuild | 1 +
include/uapi/linux/kcmp.h | 17 +++++++++++++++++
3 files changed, 18 insertions(+), 17 deletions(-)
delete mode 100644 include/linux/kcmp.h
create mode 100644 include/uapi/linux/kcmp.h
diff --git a/include/linux/kcmp.h b/include/linux/kcmp.h
deleted file mode 100644
index 2dcd1b3aafc8..000000000000
--- a/include/linux/kcmp.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _LINUX_KCMP_H
-#define _LINUX_KCMP_H
-
-/* Comparison type */
-enum kcmp_type {
- KCMP_FILE,
- KCMP_VM,
- KCMP_FILES,
- KCMP_FS,
- KCMP_SIGHAND,
- KCMP_IO,
- KCMP_SYSVSEM,
-
- KCMP_TYPES,
-};
-
-#endif /* _LINUX_KCMP_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 4c94f31a8c99..a7b3071c03f2 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -211,6 +211,7 @@ header-y += ivtvfb.h
header-y += ixjuser.h
header-y += jffs2.h
header-y += joystick.h
+header-y += kcmp.h
header-y += kd.h
header-y += kdev_t.h
header-y += kernel-page-flags.h
diff --git a/include/uapi/linux/kcmp.h b/include/uapi/linux/kcmp.h
new file mode 100644
index 000000000000..84df14b37360
--- /dev/null
+++ b/include/uapi/linux/kcmp.h
@@ -0,0 +1,17 @@
+#ifndef _UAPI_LINUX_KCMP_H
+#define _UAPI_LINUX_KCMP_H
+
+/* Comparison type */
+enum kcmp_type {
+ KCMP_FILE,
+ KCMP_VM,
+ KCMP_FILES,
+ KCMP_FS,
+ KCMP_SIGHAND,
+ KCMP_IO,
+ KCMP_SYSVSEM,
+
+ KCMP_TYPES,
+};
+
+#endif /* _UAPI_LINUX_KCMP_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 2/3] selftests/kcmp: Don't include kernel headers
2014-12-02 5:52 [PATCH 1/3] kcmp: Move kcmp.h into uapi Michael Ellerman
@ 2014-12-02 5:52 ` Michael Ellerman
2014-12-02 5:52 ` [PATCH 3/3] selftests/kcmp: Always try to build the test Michael Ellerman
1 sibling, 0 replies; 12+ messages in thread
From: Michael Ellerman @ 2014-12-02 5:52 UTC (permalink / raw)
To: linux-kernel; +Cc: shuahkh, Andrew Morton, gorcunov, Arnd Bergmann, cov
The kcmp test mucks with the include path to bring in the kernel
headers, and x86 headers too for reasons that are not clear.
Now that kcmp.h is exported none of that should be necessary.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
tools/testing/selftests/kcmp/Makefile | 4 ----
1 file changed, 4 deletions(-)
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
index 8aabd82db9e4..4f00c0524501 100644
--- a/tools/testing/selftests/kcmp/Makefile
+++ b/tools/testing/selftests/kcmp/Makefile
@@ -8,11 +8,7 @@ ifeq ($(ARCH),x86_64)
ARCH := x86
CFLAGS := -DCONFIG_X86_64 -D__x86_64__
endif
-
-CFLAGS += -I../../../../arch/x86/include/generated/
-CFLAGS += -I../../../../include/
CFLAGS += -I../../../../usr/include/
-CFLAGS += -I../../../../arch/x86/include/
all:
ifeq ($(ARCH),x86)
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] selftests/kcmp: Always try to build the test
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
2014-12-02 16:20 ` Christopher Covington
1 sibling, 1 reply; 12+ messages in thread
From: Michael Ellerman @ 2014-12-02 5:52 UTC (permalink / raw)
To: linux-kernel; +Cc: shuahkh, Andrew Morton, gorcunov, Arnd Bergmann, cov
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
2014-12-02 5:52 ` [PATCH 3/3] selftests/kcmp: Always try to build the test Michael Ellerman
@ 2014-12-02 16:20 ` Christopher Covington
2014-12-02 20:59 ` Shuah Khan
0 siblings, 1 reply; 12+ messages in thread
From: Christopher Covington @ 2014-12-02 16:20 UTC (permalink / raw)
To: Michael Ellerman
Cc: linux-kernel, shuahkh, Andrew Morton, gorcunov, Arnd Bergmann
Hi Michael,
On 12/02/2014 12:52 AM, Michael Ellerman wrote:
> 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>
For what it's worth, all three patches look good to me.
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Thanks,
Chris
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
2014-12-02 16:20 ` Christopher Covington
@ 2014-12-02 20:59 ` Shuah Khan
0 siblings, 0 replies; 12+ messages in thread
From: Shuah Khan @ 2014-12-02 20:59 UTC (permalink / raw)
To: Christopher Covington, Michael Ellerman
Cc: linux-kernel, Andrew Morton, gorcunov, Arnd Bergmann, Shuah Khan
On 12/02/2014 09:20 AM, Christopher Covington wrote:
> Hi Michael,
>
> On 12/02/2014 12:52 AM, Michael Ellerman wrote:
>> 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>
>
> For what it's worth, all three patches look good to me.
>
> Reviewed-by: Christopher Covington <cov@codeaurora.org>
>
> Thanks,
> Chris
>
All three patches queued for 3.19 - linux-kselftest.git/ fixes branch
kcmp fails on couple tests it runs when CONFIG_CHECKPOINT_RESTORE
is disabled. However, it isn't bad enough to not include the patch,
especially when there is use for it on arm.
FAIL: 0 expected but -1 returned (Function not implemented)
FAIL: 0 expected but -1 returned (Function not implemented)
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/3] kcmp: Move kcmp.h into uapi
@ 2014-10-23 5:07 Michael Ellerman
2014-10-23 5:07 ` [PATCH 3/3] selftests/kcmp: Always try to build the test Michael Ellerman
0 siblings, 1 reply; 12+ messages in thread
From: Michael Ellerman @ 2014-10-23 5:07 UTC (permalink / raw)
To: linux-kernel; +Cc: shuahkh, linux-api, Andrew Morton, gorcunov
kcmp.h appears to be part of the API, it's documented in kcmp(2), and
the selftests/kcmp code uses it. So move it to uapi so it's actually
exported.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
include/linux/kcmp.h | 13 +------------
include/uapi/linux/Kbuild | 1 +
include/uapi/linux/kcmp.h | 17 +++++++++++++++++
3 files changed, 19 insertions(+), 12 deletions(-)
create mode 100644 include/uapi/linux/kcmp.h
diff --git a/include/linux/kcmp.h b/include/linux/kcmp.h
index 2dcd1b3aafc8..9dfb23e1771b 100644
--- a/include/linux/kcmp.h
+++ b/include/linux/kcmp.h
@@ -1,17 +1,6 @@
#ifndef _LINUX_KCMP_H
#define _LINUX_KCMP_H
-/* Comparison type */
-enum kcmp_type {
- KCMP_FILE,
- KCMP_VM,
- KCMP_FILES,
- KCMP_FS,
- KCMP_SIGHAND,
- KCMP_IO,
- KCMP_SYSVSEM,
-
- KCMP_TYPES,
-};
+#include <uapi/linux/kcmp.h>
#endif /* _LINUX_KCMP_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index b70237e8bc37..1cf50d682dbf 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -209,6 +209,7 @@ header-y += ivtvfb.h
header-y += ixjuser.h
header-y += jffs2.h
header-y += joystick.h
+header-y += kcmp.h
header-y += kd.h
header-y += kdev_t.h
header-y += kernel-page-flags.h
diff --git a/include/uapi/linux/kcmp.h b/include/uapi/linux/kcmp.h
new file mode 100644
index 000000000000..84df14b37360
--- /dev/null
+++ b/include/uapi/linux/kcmp.h
@@ -0,0 +1,17 @@
+#ifndef _UAPI_LINUX_KCMP_H
+#define _UAPI_LINUX_KCMP_H
+
+/* Comparison type */
+enum kcmp_type {
+ KCMP_FILE,
+ KCMP_VM,
+ KCMP_FILES,
+ KCMP_FS,
+ KCMP_SIGHAND,
+ KCMP_IO,
+ KCMP_SYSVSEM,
+
+ KCMP_TYPES,
+};
+
+#endif /* _UAPI_LINUX_KCMP_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 3/3] selftests/kcmp: Always try to build the test
2014-10-23 5:07 [PATCH 1/3] kcmp: Move kcmp.h into uapi Michael Ellerman
@ 2014-10-23 5:07 ` Michael Ellerman
2014-10-23 6:09 ` Cyrill Gorcunov
2014-10-23 13:06 ` Christopher Covington
0 siblings, 2 replies; 12+ messages in thread
From: Michael Ellerman @ 2014-10-23 5:07 UTC (permalink / raw)
To: linux-kernel; +Cc: shuahkh, linux-api, Andrew Morton, gorcunov
Don't prevent the test building on non-x86. Just try and build it and
let the chips fall where they may.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
tools/testing/selftests/kcmp/Makefile | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
index 4f00c0524501..cda9cc4004c9 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
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
run_tests: all
@./kcmp_test || echo "kcmp_test: [FAIL]"
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
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
1 sibling, 1 reply; 12+ messages in thread
From: Cyrill Gorcunov @ 2014-10-23 6:09 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linux-kernel, shuahkh, linux-api, Andrew Morton
On Thu, Oct 23, 2014 at 04:07:14PM +1100, Michael Ellerman wrote:
> Don't prevent the test building on non-x86. Just try and build it and
> let the chips fall where they may.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
kcmp depends on checkpoint/restore config symbol which is known
to work on x86 and (iirc) on arm, that's why x86 was only allowed.
I don't mind to such change but not sure.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
2014-10-23 6:09 ` Cyrill Gorcunov
@ 2014-12-02 5:53 ` Michael Ellerman
0 siblings, 0 replies; 12+ messages in thread
From: Michael Ellerman @ 2014-12-02 5:53 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: linux-kernel, shuahkh, linux-api, Andrew Morton
On Thu, 2014-10-23 at 10:09 +0400, Cyrill Gorcunov wrote:
> On Thu, Oct 23, 2014 at 04:07:14PM +1100, Michael Ellerman wrote:
> > Don't prevent the test building on non-x86. Just try and build it and
> > let the chips fall where they may.
> >
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> kcmp depends on checkpoint/restore config symbol which is known
> to work on x86 and (iirc) on arm, that's why x86 was only allowed.
> I don't mind to such change but not sure.
Yeah I understand. It's helpful for the other architectures to be able to build
the test, that way we at least know that it's something we should think about
implementing/fixing. If the test doesn't build at all then we just ignore it :)
cheers
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
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-10-23 13:06 ` Christopher Covington
2014-10-23 13:52 ` Shuah Khan
2014-12-02 5:44 ` Michael Ellerman
1 sibling, 2 replies; 12+ messages in thread
From: Christopher Covington @ 2014-10-23 13:06 UTC (permalink / raw)
To: Michael Ellerman
Cc: linux-kernel, shuahkh, linux-api, Andrew Morton, gorcunov
Hi Michael,
On 10/23/2014 01:07 AM, Michael Ellerman wrote:
> Don't prevent the test building on non-x86. Just try and build it and
> let the chips fall where they may.
As a user of kcmp via CRIU on arm and arm64, thanks!
> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
> index 4f00c0524501..cda9cc4004c9 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
> CFLAGS += -I../../../../usr/include/
>
> all:
> -ifeq ($(ARCH),x86)
> gcc $(CFLAGS) kcmp_test.c -o kcmp_test
Not that this needs to be addressed in this patch, but this looks broken for
cross compilation. It looks like some of the other selftests use:
CC = $(CROSS_COMPILE)gcc
But perhaps this should be set (and perhaps with ':=') once at the top level.
Chris
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
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
1 sibling, 1 reply; 12+ messages in thread
From: Shuah Khan @ 2014-10-23 13:52 UTC (permalink / raw)
To: Christopher Covington, Michael Ellerman
Cc: linux-kernel, linux-api, Andrew Morton, gorcunov
On 10/23/2014 07:06 AM, Christopher Covington wrote:
> Hi Michael,
>
> On 10/23/2014 01:07 AM, Michael Ellerman wrote:
>> Don't prevent the test building on non-x86. Just try and build it and
>> let the chips fall where they may.
>
> As a user of kcmp via CRIU on arm and arm64, thanks!
>
>> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
>> index 4f00c0524501..cda9cc4004c9 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
>> CFLAGS += -I../../../../usr/include/
>>
>> all:
>> -ifeq ($(ARCH),x86)
>> gcc $(CFLAGS) kcmp_test.c -o kcmp_test
>
> Not that this needs to be addressed in this patch, but this looks broken for
> cross compilation. It looks like some of the other selftests use:
>
> CC = $(CROSS_COMPILE)gcc
>
It makes sense to fix the cross-compile problem now, since
this patch is extending the support to other archs.
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
2014-10-23 13:52 ` Shuah Khan
@ 2014-12-01 16:58 ` Shuah Khan
0 siblings, 0 replies; 12+ messages in thread
From: Shuah Khan @ 2014-12-01 16:58 UTC (permalink / raw)
To: Christopher Covington, Michael Ellerman
Cc: linux-kernel, linux-api, Andrew Morton, gorcunov, Shuah Khan
On 10/23/2014 07:52 AM, Shuah Khan wrote:
> On 10/23/2014 07:06 AM, Christopher Covington wrote:
>> Hi Michael,
>>
>> On 10/23/2014 01:07 AM, Michael Ellerman wrote:
>>> Don't prevent the test building on non-x86. Just try and build it and
>>> let the chips fall where they may.
>>
>> As a user of kcmp via CRIU on arm and arm64, thanks!
>>
>>> diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
>>> index 4f00c0524501..cda9cc4004c9 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
>>> CFLAGS += -I../../../../usr/include/
>>>
>>> all:
>>> -ifeq ($(ARCH),x86)
>>> gcc $(CFLAGS) kcmp_test.c -o kcmp_test
>>
>> Not that this needs to be addressed in this patch, but this looks broken for
>> cross compilation. It looks like some of the other selftests use:
>>
>> CC = $(CROSS_COMPILE)gcc
>>
>
> It makes sense to fix the cross-compile problem now, since
> this patch is extending the support to other archs.
>
> thanks,
> -- Shuah
>
>
Please address the cross-compile problems in your next patch version.
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] selftests/kcmp: Always try to build the test
2014-10-23 13:06 ` Christopher Covington
2014-10-23 13:52 ` Shuah Khan
@ 2014-12-02 5:44 ` Michael Ellerman
1 sibling, 0 replies; 12+ messages in thread
From: Michael Ellerman @ 2014-12-02 5:44 UTC (permalink / raw)
To: Christopher Covington
Cc: linux-kernel, shuahkh, linux-api, Andrew Morton, gorcunov
On Thu, 2014-10-23 at 09:06 -0400, Christopher Covington wrote:
> Hi Michael,
>
> On 10/23/2014 01:07 AM, Michael Ellerman wrote:
> > Don't prevent the test building on non-x86. Just try and build it and
> > let the chips fall where they may.
>
> As a user of kcmp via CRIU on arm and arm64, thanks!
>
> > diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile
> > index 4f00c0524501..cda9cc4004c9 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
> > CFLAGS += -I../../../../usr/include/
> >
> > all:
> > -ifeq ($(ARCH),x86)
> > gcc $(CFLAGS) kcmp_test.c -o kcmp_test
>
> Not that this needs to be addressed in this patch, but this looks broken for
> cross compilation. It looks like some of the other selftests use:
>
> CC = $(CROSS_COMPILE)gcc
>
> But perhaps this should be set (and perhaps with ':=') once at the top level.
The best solution IMHO is:
CC := $(CROSS_COMPILE)$(CC)
Because it allows cross compiling, but also allows overriding of CC.
Will resend with that change.
cheers
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-12-02 20:59 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 3/3] selftests/kcmp: Always try to build the test Michael Ellerman
2014-12-02 16:20 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox