File perf-jvmti-fix-linker-error-when-libelf-config-is-disabled.patch of Package perf
52
1
From: Sudeep Holla <Sudeep.Holla@arm.com>
2
Date: Tue, 18 Jul 2017 18:18:39 -0700
3
Subject: perf jvmti: Fix linker error when libelf config is disabled
4
Git-commit: 5d90faf45427dd76fadbe7a4dc4fce3b6f87b550
5
Patch-mainline: v4.14-rc1
6
References: bsc#1070010 (git-fixes)
7
Signed-off-By: Tony Jones <tonyj@suse.de>
8
9
When libelf is disabled in the configuration, we get the following
10
linker error:
11
12
LINK libperf-jvmti.so
13
ld: cannot find -lelf
14
Makefile.perf:515: recipe for target 'libperf-jvmti.so' failed
15
16
Jiri pointed out that both librt and libelf are not really required. So
17
this patch fixes the linker error by getting rid of unwanted libraries
18
in the linker stage.
19
20
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
21
Acked-by: David Carrillo-Cisneros <davidcc@google.com>
22
Acked-by: Jiri Olsa <jolsa@kernel.org>
23
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
24
Cc: Elena Reshetova <elena.reshetova@intel.com>
25
Cc: Kees Kook <keescook@chromium.org>
26
Cc: Paul Turner <pjt@google.com>
27
Cc: Peter Zijlstra <peterz@infradead.org>
28
Cc: Stephane Eranian <eranian@google.com>
29
Cc: Sudeep Holla <sudeep.holla@arm.com>
30
Cc: Wang Nan <wangnan0@huawei.com>
31
Fixes: 209045adc2bb ("perf tools: add JVMTI agent library")
32
Link: http://lkml.kernel.org/r/20170719011839.99399-5-davidcc@google.com
33
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
34
---
35
tools/perf/Makefile.perf | 2 +-
36
1 file changed, 1 insertion(+), 1 deletion(-)
37
38
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
39
index 100a6c1670c8..d66f90e6be5c 100644
40
--- a/tools/perf/Makefile.perf
41
+++ b/tools/perf/Makefile.perf
42
43
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti
44
45
$(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN)
46
- $(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< -lelf -lrt
47
+ $(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $<
48
endif
49
50
$(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
51
52