[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260128-b4-futex-test-v1-1-ce73742068ad@sifive.com>
Date: Wed, 28 Jan 2026 22:32:52 -0800
From: Nylon Chen <nylon.chen@...ive.com>
To: Thomas Gleixner <tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>,
André Almeida <andrealmeid@...lia.com>,
Shuah Khan <shuah@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Zong Li <zong.li@...ive.com>, Nylon Chen <nylon.chen@...ive.com>
Subject: [PATCH] selftests/futex: skip futex_numa_mpol without libnuma
Use pkg-config --exists numa to derive HAVE_LIBNUMA.
Only keep futex_numa_mpol in TEST_GEN_PROGS when libnuma is present.
Signed-off-by: Zong Li <zong.li@...ive.com>
Signed-off-by: Nylon Chen <nylon.chen@...ive.com>
---
tools/testing/selftests/futex/functional/Makefile | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index af7ec309ea78..ec3c39a51182 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
PKG_CONFIG ?= pkg-config
+HAVE_LIBNUMA := $(shell sh -c "$(PKG_CONFIG) --exists numa > /dev/null 2>&1 && echo y")
LIBNUMA_TEST = $(shell sh -c "$(PKG_CONFIG) numa --atleast-version 2.0.16 > /dev/null 2>&1 && echo SUFFICIENT || echo NO")
INCLUDES := -I../include -I../../ $(KHDR_INCLUDES)
CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 $(INCLUDES) $(KHDR_INCLUDES) -DLIBNUMA_VER_$(LIBNUMA_TEST)=1
-LDLIBS := -lpthread -lrt -lnuma
LOCAL_HDRS := \
../include/futextest.h \
@@ -27,6 +27,13 @@ TEST_GEN_PROGS := \
TEST_PROGS := run.sh
+ifeq ($(HAVE_LIBNUMA),y)
+LDLIBS := -lpthread -lrt -lnuma
+else
+LDLIBS := -lpthread -lrt
+TEST_GEN_PROGS := $(filter-out futex_numa_mpol,$(TEST_GEN_PROGS))
+endif
+
top_srcdir = ../../../../..
DEFAULT_INSTALL_HDR_PATH := 1
include ../../lib.mk
---
base-commit: 8dfce8991b95d8625d0a1d2896e42f93b9d7f68d
change-id: 20260128-b4-futex-test-6de3aca9a3f6
Best regards,
--
Nylon Chen <nylon.chen@...ive.com>
Powered by blists - more mailing lists