From: Thomas Gleixner <tglx@kernel.org>
To: "Nylon Chen" <nylon.chen@sifive.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Darren Hart" <dvhart@infradead.org>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"André Almeida" <andrealmeid@igalia.com>,
"Shuah Khan" <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Zong Li <zong.li@sifive.com>, Nylon Chen <nylon.chen@sifive.com>
Subject: Re: [PATCH] selftests/futex: skip futex_numa_mpol without libnuma
Date: Tue, 03 Feb 2026 22:35:04 +0100 [thread overview]
Message-ID: <877bst33zr.ffs@tglx> (raw)
In-Reply-To: <20260128-b4-futex-test-v1-1-ce73742068ad@sifive.com>
On Wed, Jan 28 2026 at 22:32, Nylon Chen wrote:
> 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@sifive.com>
> Signed-off-by: Nylon Chen <nylon.chen@sifive.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")
Why another test? LIBNUMA_TEST fails when it does not exist or when the
version number is not enough.
> 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))
Why? The test contains more than just the libnuma dependend stuff. There
are two issues here:
One is -lnuma, which is trivial to solve:
LDLIBS := -lpthread -lrt
ifeq ($(LIBNUMA_TEST),SUFFICIENT)
LDLIBS += -lnuma
endif
The other is the include <numa*.h> in the source. I assume you can
figure out how to prevent those headers from being included, right?
Thanks,
tglx
next prev parent reply other threads:[~2026-02-03 21:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 6:32 [PATCH] selftests/futex: skip futex_numa_mpol without libnuma Nylon Chen
2026-02-03 21:35 ` Thomas Gleixner [this message]
2026-02-09 2:33 ` Nylon Chen
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=877bst33zr.ffs@tglx \
--to=tglx@kernel.org \
--cc=andrealmeid@igalia.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nylon.chen@sifive.com \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=zong.li@sifive.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.