All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mykola Lysenko <nickolay.lysenko@gmail.com>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	eddyz87@gmail.com, martin.lau@linux.dev, song@kernel.org,
	yonghong.song@linux.dev, jolsa@kernel.org, memxor@gmail.com,
	nickolay.lysenko@gmail.com
Subject: [RFC PATCH bpf-next v5 2/8] selftests/bpf: drop stale and no-op lines
Date: Tue,  4 Aug 2026 10:01:50 -0700	[thread overview]
Message-ID: <20260804170156.1709916-3-nickolay.lysenko@gmail.com> (raw)
In-Reply-To: <20260804170156.1709916-1-nickolay.lysenko@gmail.com>

Four target-specific lines name objects nothing builds. Three went
dead when commit afef88e65554 ("selftests/bpf: Store BPF object files
with .bpf.o extension") renamed the BPF objects; the
flow_dissector_load.o dependency names an intermediate the generic
one-step compile+link rule does not produce.

The '-fno-inline' pair (test_l4lb_noinline, test_xdp_noinline)
applied the flag until the rename; both programs have compiled
without it since, and nothing was lost: every function in them
carries a noinline annotation (the single __always_inline helper in
each is a deliberate exception the flag never overrode), and
compiling with -fno-inline restored yields byte-identical objects.

The two header dependencies with remaining value are redeclared in
working form. flow_dissector_load.h moves to the binary itself, which
is linked straight from its .c by the generic '$(OUTPUT)/%:%.c' rule
- editing the header now rebuilds it. cgroup_getset_retval_hooks.h -
added by commit e7215f574079 ("selftests/bpf: Make sure
bpf_{g,s}et_retval is exposed everywhere") days before the rename
orphaned it - is redeclared against the .bpf.o of every flavor: the
header lives in the top directory, outside the progs/*.h blanket
prerequisite, so editing it never rebuilt the BPF object. (Its
userspace consumer is tracked exactly by the compiler-generated
dependency files.)

'CURDIR := $(abspath .)' redefines make's builtin to the value it
already has; drop it too.

Signed-off-by: Mykola Lysenko <nickolay.lysenko@gmail.com>
---
 tools/testing/selftests/bpf/Makefile | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 65c702613..69093fba3 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -6,7 +6,6 @@ include ../../../scripts/Makefile.include
 CXX ?= $(CROSS_COMPILE)g++
 OBJCOPY ?= $(CROSS_COMPILE)objcopy
 
-CURDIR := $(abspath .)
 TOOLSDIR := $(abspath ../../..)
 LIBDIR := $(TOOLSDIR)/lib
 BPFDIR := $(LIBDIR)/bpf
@@ -480,11 +479,14 @@ BPF_CFLAGS = -g -Wall -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN)	\
 
 CLANG_CFLAGS = $(CLANG_SYS_INCLUDES)
 
-$(OUTPUT)/test_l4lb_noinline.o: BPF_CFLAGS += -fno-inline
-$(OUTPUT)/test_xdp_noinline.o: BPF_CFLAGS += -fno-inline
+$(OUTPUT)/flow_dissector_load: flow_dissector_load.h
 
-$(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
-$(OUTPUT)/cgroup_getset_retval_hooks.o: cgroup_getset_retval_hooks.h
+# progs/cgroup_getset_retval_hooks.c includes this top-directory header,
+# which the progs/*.h prerequisite of the BPF object rules does not
+# cover.
+$(addprefix $(OUTPUT)/,cgroup_getset_retval_hooks.bpf.o \
+	$(addsuffix /cgroup_getset_retval_hooks.bpf.o,$(TEST_INST_SUBDIRS))): \
+	cgroup_getset_retval_hooks.h
 
 # Build BPF object using Clang
 # $1 - input .c file
-- 
2.43.0


  parent reply	other threads:[~2026-08-04 17:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 17:01 [RFC PATCH bpf-next v5 0/8] selftests/bpf: restructure the Makefile as a layered build Mykola Lysenko
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 1/8] selftests/bpf: keep headers off the generic link command line Mykola Lysenko
2026-08-05 21:21   ` Eduard Zingerman
2026-08-04 17:01 ` Mykola Lysenko [this message]
2026-08-05 21:28   ` [RFC PATCH bpf-next v5 2/8] selftests/bpf: drop stale and no-op lines Eduard Zingerman
2026-08-06  4:43     ` Mykola Lysenko
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 3/8] selftests/bpf: factor the permissive-mode skip suffix into a helper Mykola Lysenko
2026-08-04 17:21   ` sashiko-bot
2026-08-05  0:13     ` Mykola Lysenko
2026-08-05 21:33   ` Eduard Zingerman
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 4/8] selftests/bpf: generate the signing key and certificate once Mykola Lysenko
2026-08-05 22:03   ` Eduard Zingerman
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 5/8] selftests/bpf: generate verifier/tests.h in a regular recipe Mykola Lysenko
2026-08-05 22:11   ` Eduard Zingerman
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 6/8] selftests/bpf: extract BPF skeleton generation into a helper script Mykola Lysenko
2026-08-04 17:59   ` sashiko-bot
2026-08-05  1:40     ` Mykola Lysenko
2026-08-05 22:39   ` Eduard Zingerman
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 7/8] selftests/bpf: move shared build definitions into Makefile.buildvars Mykola Lysenko
2026-08-05 23:34   ` Eduard Zingerman
2026-08-06  4:51     ` Mykola Lysenko
2026-08-04 17:01 ` [RFC PATCH bpf-next v5 8/8] selftests/bpf: build each test runner instance in its own sub-make Mykola Lysenko
2026-08-06  8:02   ` Eduard Zingerman
2026-08-06 18:30     ` Eduard Zingerman
2026-08-23  0:37       ` Mykola Lysenko
2026-08-23  0:34     ` Mykola Lysenko
2026-08-24 18:37       ` Eduard Zingerman

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=20260804170156.1709916-3-nickolay.lysenko@gmail.com \
    --to=nickolay.lysenko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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.