1
linux/tools/build/feature
Yang Jihong a530337ba9 perf build: Fix build feature-dwarf_getlocations fail for old libdw
For libdw versions below 0.177, need to link libdl.a in addition to
libbebl.a during static compilation, otherwise
feature-dwarf_getlocations compilation will fail.

Before:

  $ make LDFLAGS=-static
    BUILD:   Doing 'make -j20' parallel build
  <SNIP>
  Makefile.config:483: Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157
  <SNIP>

  $ cat ../build/feature/test-dwarf_getlocations.make.output
  /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libebl.a(eblclosebackend.o): in function `ebl_closebackend':
  (.text+0x20): undefined reference to `dlclose'
  collect2: error: ld returned 1 exit status

After:

  $ make LDFLAGS=-static
  <SNIP>
    Auto-detecting system features:
  ...                                   dwarf: [ on  ]
  <SNIP>

    $ ./perf probe
   Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
      or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
      or: perf probe [<options>] --del '[GROUP:]EVENT' ...
      or: perf probe --list [GROUP:]EVENT ...
  <SNIP>

Fixes: 536661da6e ("perf: build: Only link libebl.a for old libdw")
Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Yang Jihong <yangjihong@bytedance.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240919013513.118527-3-yangjihong@bytedance.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-10-02 18:21:49 -03:00
..
.gitignore
Makefile perf build: Fix build feature-dwarf_getlocations fail for old libdw 2024-10-02 18:21:49 -03:00
test-all.c perf build: Fix up broken capstone feature detection fast path 2024-08-14 10:44:26 -03:00
test-backtrace.c
test-bionic.c
test-bpf.c
test-clang-bpf-co-re.c
test-compile.c
test-cplus-demangle.c
test-cxa-demangle.cpp
test-disassembler-four-args.c
test-disassembler-init-styled.c
test-dwarf_getcfi.c perf build: Add feature check for dwarf_getcfi() 2023-11-10 09:04:16 -03:00
test-dwarf_getlocations.c
test-dwarf.c
test-eventfd.c
test-file-handle.c
test-fortify-source.c
test-get_cpuid.c
test-get_current_dir_name.c
test-gettid.c
test-glibc.c
test-gtk2-infobar.c
test-gtk2.c
test-hello.c
test-jvmti-cmlr.c
test-jvmti.c
test-libaio.c
test-libaudit.c
test-libbabeltrace.c
test-libbfd-buildid.c
test-libbfd.c
test-libbpf.c
test-libcap.c Revert "tools build: Remove leftover libcap tests that prevents fast path feature detection from working" 2024-08-29 11:51:43 -03:00
test-libcapstone.c perf: build: introduce the libcapstone 2024-02-20 18:06:25 -08:00
test-libcrypto.c
test-libdebuginfod.c
test-libdw-dwarf-unwind.c
test-libelf-gelf_getnote.c
test-libelf-getphdrnum.c
test-libelf-getshdrstrndx.c
test-libelf.c
test-libnuma.c
test-libopencsd.c perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present 2023-11-27 10:21:27 -03:00
test-libperl.c
test-libpfm4.c
test-libpython.c
test-libslang-include-subdir.c
test-libslang.c
test-libtraceevent.c
test-libtracefs.c perf build: Use pkg-config for feature check for libtrace{event,fs} 2024-06-21 16:19:03 -07:00
test-libunwind-aarch64.c
test-libunwind-arm.c
test-libunwind-debug-frame-aarch64.c
test-libunwind-debug-frame-arm.c
test-libunwind-debug-frame.c
test-libunwind-x86_64.c
test-libunwind-x86.c
test-libunwind.c
test-libzstd.c
test-llvm-perf.cpp perf build: Autodetect minimum required llvm-dev version 2024-09-10 17:32:46 -03:00
test-llvm.cpp
test-lzma.c
test-numa_num_possible_cpus.c
test-pthread-attr-setaffinity-np.c
test-pthread-barrier.c
test-reallocarray.c
test-scandirat.c
test-sched_getcpu.c
test-sdt.c
test-setns.c
test-stackprotector-all.c
test-timerfd.c
test-zlib.c