Li Huafei
d5c0f016ae
perf unwind: Do not overwrite FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64}
[ Upstream commit cdf32b44678c382a31dc183d9a767306915cda7b ]
When setting LIBUNWIND_DIR, we first set
FEATURE_CHECK_LDFLAGS-libunwind-{aarch64,x86} = -L$(LIBUNWIND_DIR)/lib.
<committer note>
This happens a bit before, the overwritting, in:
libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
define libunwind_arch_set_flags_code
FEATURE_CHECK_CFLAGS-libunwind-$(1) = -I$(LIBUNWIND_DIR)/include
FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
endef
ifdef LIBUNWIND_DIR
LIBUNWIND_CFLAGS = -I$(LIBUNWIND_DIR)/include
LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64
$(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
endif
Look at that 'foreach' on all the LIBUNWIND_ARCHS.
</>
After commit 5c4d7c82c0 ("perf unwind: Do not put libunwind-{x86,aarch64}
in FEATURE_TESTS_BASIC"), FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} is
overwritten. As a result, the remote libunwind libraries cannot be searched
from $(LIBUNWIND_DIR)/lib directory during feature check tests. Fix it with
variable appending.
Before this patch:
perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64
BUILD: Doing 'make -j16' parallel build
<SNIP>
...
... libopencsd: [ OFF ]
... libunwind-x86: [ OFF ]
... libunwind-x86_64: [ OFF ]
... libunwind-arm: [ OFF ]
... libunwind-aarch64: [ OFF ]
... libunwind-debug-frame: [ OFF ]
... libunwind-debug-frame-arm: [ OFF ]
... libunwind-debug-frame-aarch64: [ OFF ]
... cxx: [ OFF ]
<SNIP>
perf$ cat ../build/feature/test-libunwind-aarch64.make.output
/usr/bin/ld: cannot find -lunwind-aarch64
/usr/bin/ld: cannot find -lunwind-aarch64
collect2: error: ld returned 1 exit status
After this patch:
perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64
BUILD: Doing 'make -j16' parallel build
<SNIP>
... libopencsd: [ OFF ]
... libunwind-x86: [ OFF ]
... libunwind-x86_64: [ OFF ]
... libunwind-arm: [ OFF ]
... libunwind-aarch64: [ on ]
... libunwind-debug-frame: [ OFF ]
... libunwind-debug-frame-arm: [ OFF ]
... libunwind-debug-frame-aarch64: [ OFF ]
... cxx: [ OFF ]
<SNIP>
perf$ cat ../build/feature/test-libunwind-aarch64.make.output
perf$ ldd ./perf
linux-vdso.so.1 (0x00007ffdf07da000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f30953dc000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f30951d4000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3094e36000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3094c32000)
libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f3094a18000)
libdw.so.1 => /usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007f30947cc000)
libunwind-x86_64.so.8 => /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007f30945ad000)
libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f3094392000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f309416c000)
libunwind-aarch64.so.8 => not found
libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f3093c8a000)
libpython2.7.so.1.0 => /usr/local/lib/libpython2.7.so.1.0 (0x00007f309386b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f309364e000)
libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f3093443000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3093052000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3096097000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f3092e42000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3092c3f000)
Fixes: 5c4d7c82c0 ("perf unwind: Do not put libunwind-{x86,aarch64} in FEATURE_TESTS_BASIC")
Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zhang Jinhao <zhangjinhao2@huawei.com>
Link: http://lore.kernel.org/lkml/20210823134340.60955-1-lihuafei1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
2021-09-22 12:26:45 +02:00 |
| .. |
|
arch
|
|
|
|
bench
|
perf bench: Fix 2 memory sanitizer warnings
|
2021-07-19 08:53:14 +02:00 |
|
Documentation
|
|
|
|
examples/bpf
|
|
|
|
include/bpf
|
|
|
|
jvmti
|
|
|
|
lib
|
|
|
|
pmu-events
|
perf jevents: Fix getting maximum number of fds
|
2021-06-03 08:59:08 +02:00 |
|
python
|
tweewide: Fix most Shebang lines
|
2021-05-22 11:38:30 +02:00 |
|
scripts
|
perf scripts python: exported-sql-viewer.py: Fix warning display
|
2021-06-03 08:59:00 +02:00 |
|
tests
|
perf test event_update: Fix memory leak of evlist
|
2021-07-28 13:30:54 +02:00 |
|
trace
|
perf beauty: Fix fsconfig generator
|
2021-05-14 09:44:30 +02:00 |
|
ui
|
|
|
|
util
|
perf machine: Initialize srcline string member in add_location struct
|
2021-09-22 12:26:41 +02:00 |
|
.gitignore
|
|
|
|
Build
|
|
|
|
builtin-annotate.c
|
|
|
|
builtin-bench.c
|
|
|
|
builtin-buildid-cache.c
|
|
|
|
builtin-buildid-list.c
|
|
|
|
builtin-c2c.c
|
|
|
|
builtin-config.c
|
|
|
|
builtin-data.c
|
|
|
|
builtin-diff.c
|
|
|
|
builtin-evlist.c
|
|
|
|
builtin-ftrace.c
|
perf ftrace: Fix access to pid in array when setting a pid filter
|
2021-05-07 10:51:37 +02:00 |
|
builtin-help.c
|
|
|
|
builtin-inject.c
|
perf inject: Close inject.output on exit
|
2021-07-28 13:31:02 +02:00 |
|
builtin-kallsyms.c
|
|
|
|
builtin-kmem.c
|
|
|
|
builtin-kvm.c
|
|
|
|
builtin-list.c
|
|
|
|
builtin-lock.c
|
|
|
|
builtin-mem.c
|
|
|
|
builtin-probe.c
|
|
|
|
builtin-record.c
|
|
|
|
builtin-report.c
|
|
|
|
builtin-sched.c
|
|
|
|
builtin-script.c
|
perf script: Fix memory 'threads' and 'cpus' leaks on exit
|
2021-07-28 13:30:54 +02:00 |
|
builtin-stat.c
|
|
|
|
builtin-timechart.c
|
|
|
|
builtin-top.c
|
|
|
|
builtin-trace.c
|
|
|
|
builtin-version.c
|
|
|
|
builtin.h
|
|
|
|
check-headers.sh
|
|
|
|
command-list.txt
|
|
|
|
CREDITS
|
|
|
|
design.txt
|
|
|
|
Makefile
|
|
|
|
Makefile.config
|
perf unwind: Do not overwrite FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64}
|
2021-09-22 12:26:45 +02:00 |
|
Makefile.perf
|
|
|
|
MANIFEST
|
|
|
|
perf-archive.sh
|
|
|
|
perf-completion.sh
|
|
|
|
perf-read-vdso.c
|
|
|
|
perf-sys.h
|
|
|
|
perf-with-kcore.sh
|
|
|
|
perf.c
|
|
|
|
perf.h
|
|
|