[PATCH v6 01/13] perf jvmti: Link the agent with EXTRA_CFLAGS
From: Arnaldo Carvalho de Melo
Date: Tue Nov 17 2026 - 15:05:06 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
The jvmti objects are compiled with EXTRA_CFLAGS but the agent is linked
with LDFLAGS only, so flags with link-time parts never reach the shared
object. With -fprofile-instr-generate the agent's __profc counters had
no __llvm_profile runtime to write them, and its files showed 0.00% in
the coverage report.
Pass EXTRA_CFLAGS at link time, as the dlfilter rule already does.
Signed-off-by: Arnaldo Carvalho de Melo <acme@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 b74b534e1153ffcb..9f3e248d5c4efff8 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -791,7 +791,7 @@ $(LIBJVMTI_IN): prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti
$(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN)
- $(QUIET_LINK)$(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $<
+ $(QUIET_LINK)$(CC) $(LDFLAGS) $(EXTRA_CFLAGS) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $<
endif
$(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
--
2.56.0