The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] perf build: Fix static build of dlfilters
@ 2026-07-13 10:23 Leo Yan
  2026-07-13 17:38 ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Yan @ 2026-07-13 10:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim, Jiri Olsa, Ian Rogers,
	Adrian Hunter, James Clark, Trevor Allison
  Cc: linux-perf-users, linux-kernel, Leo Yan

Commit e1065ed188cf ("perf build: Add LDFLAGS to dlfilters .so link")
passes LDFLAGS when linking dlfilter shared objects. That breaks static
builds because LDFLAGS can contain -static, leading to an invalid link
command.

dlfilters are always built as shared objects, even for a static perf
binary. Filter out -static for the dlfilter .so link while preserving
the rest of LDFLAGS.

Fixes: e1065ed188cf ("perf build: Add LDFLAGS to dlfilters .so link")
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
 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 2b53d9e0c73b3382724b1f776880aaa8fa505f59..0031112c036e830e50711d5cb0b3867cba36e374 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

---
base-commit: ef3af1df4f3372bd8ad47619452a283048b3bc8d
change-id: 20260713-perf_fix_static_build-6db03942fee1

Best regards,
-- 
Leo Yan <leo.yan@arm.com>


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

end of thread, other threads:[~2026-07-13 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 10:23 [PATCH] perf build: Fix static build of dlfilters Leo Yan
2026-07-13 17:38 ` Namhyung Kim
2026-07-13 18:14   ` Leo Yan
2026-07-13 20:54     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox