linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] selftests: proc: Fix proc-empty-vm build error on non x86_64
@ 2022-11-09 22:11 Punit Agrawal
  2022-11-09 22:11 ` [PATCH v2 2/2] selftests: proc: Mark proc-pid-vm as x86_64 only Punit Agrawal
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Punit Agrawal @ 2022-11-09 22:11 UTC (permalink / raw)
  To: akpm, shuah
  Cc: adobriyan, linux-kernel, linux-fsdevel, linux-kselftest,
	Punit Agrawal

The proc-empty-vm test is implemented for x86_64 and fails to build
for other architectures. Rather then emitting a compiler error it
would be preferable to only build the test on supported architectures.

Mark proc-empty-vm as a test for x86_64 and customise the Makefile to
build it only when building for this target architecture.

Fixes: 5bc73bb3451b ("proc: test how it holds up with mapping'less process")
Signed-off-by: Punit Agrawal <punit.agrawal@bytedance.com>
---
v1 -> v2
* Fixed missing compilation on x86_64

Previous version
* https://lore.kernel.org/all/20221109110621.1791999-1-punit.agrawal@bytedance.com/

tools/testing/selftests/proc/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile
index cd95369254c0..743aaa0cdd52 100644
--- a/tools/testing/selftests/proc/Makefile
+++ b/tools/testing/selftests/proc/Makefile
@@ -1,14 +1,16 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+# When ARCH not overridden for crosscompiling, lookup machine
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+
 CFLAGS += -Wall -O2 -Wno-unused-function
 CFLAGS += -D_GNU_SOURCE
 LDFLAGS += -pthread
 
-TEST_GEN_PROGS :=
 TEST_GEN_PROGS += fd-001-lookup
 TEST_GEN_PROGS += fd-002-posix-eq
 TEST_GEN_PROGS += fd-003-kthread
 TEST_GEN_PROGS += proc-loadavg-001
-TEST_GEN_PROGS += proc-empty-vm
 TEST_GEN_PROGS += proc-pid-vm
 TEST_GEN_PROGS += proc-self-map-files-001
 TEST_GEN_PROGS += proc-self-map-files-002
@@ -26,4 +28,8 @@ TEST_GEN_PROGS += thread-self
 TEST_GEN_PROGS += proc-multiple-procfs
 TEST_GEN_PROGS += proc-fsconfig-hidepid
 
+TEST_GEN_PROGS_x86_64 += proc-empty-vm
+
+TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH))
+
 include ../lib.mk
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-10 14:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-09 22:11 [PATCH v2 1/2] selftests: proc: Fix proc-empty-vm build error on non x86_64 Punit Agrawal
2022-11-09 22:11 ` [PATCH v2 2/2] selftests: proc: Mark proc-pid-vm as x86_64 only Punit Agrawal
2022-11-10  1:12   ` Shuah Khan
2022-11-10  0:02 ` [PATCH v2 1/2] selftests: proc: Fix proc-empty-vm build error on non x86_64 Andrew Morton
2022-11-10  1:44   ` Shuah Khan
2022-11-10 14:34   ` [External] " Punit Agrawal
2022-11-10  0:20 ` Shuah Khan
2022-11-10 14:45   ` [External] " Punit Agrawal

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).