[PATCH] perf build: Do not pass -static to dlfilters

From: Namhyung Kim

Date: Mon Jul 06 2026 - 20:04:12 EST


The recent commit caused a failure in make build-test for static builds.
Let's not pass -static the option to dlfilters which is dynamically
loaded as it's hard-coded with -shared even for static builds.

Fixes: e1065ed188cf ("perf build: Add LDFLAGS to dlfilters .so link")
Cc: Trevor Allison <tallison@xxxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/Makefile.perf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 2b53d9e0c73b3382..0031112c036e830e 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -680,7 +680,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
.SECONDARY: $(DLFILTERS:.so=.o)

$(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
- $(QUIET_LINK)$(CC) $(LDFLAGS) $(EXTRA_CFLAGS) -shared -o $@ $<
+ $(QUIET_LINK)$(CC) $(filter-out -static,$(LDFLAGS)) $(EXTRA_CFLAGS) -shared -o $@ $<

ifndef NO_JVMTI
LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o
--
2.55.0.rc2.803.g1fd1e6609c-goog