Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf build: Feature test for libbfd thread safety API

The non-distro build requires libbfd 2.42 since commit b72b8132d8fd
("perf libbfd: Ensure libbfd is initialized prior to use"). Add a
feature test so that it's obvious why the build fails if this criteria
isn't met.

Signed-off-by: James Clark <james.clark@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
cff602f6 c0cb97a2

+28
+1
tools/build/Makefile.feature
··· 71 71 gettid \ 72 72 glibc \ 73 73 libbfd \ 74 + libbfd-threadsafe \ 74 75 libelf \ 75 76 libelf-getphdrnum \ 76 77 libelf-gelf_getnote \
+4
tools/build/feature/Makefile
··· 13 13 test-gtk2-infobar.bin \ 14 14 test-hello.bin \ 15 15 test-libbfd.bin \ 16 + test-libbfd-threadsafe.bin \ 16 17 test-disassembler-four-args.bin \ 17 18 test-disassembler-init-styled.bin \ 18 19 test-reallocarray.bin \ ··· 267 266 268 267 $(OUTPUT)test-libbfd.bin: 269 268 $(BUILD_BFD) 269 + 270 + $(OUTPUT)test-libbfd-threadsafe.bin: 271 + $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz 270 272 271 273 $(OUTPUT)test-disassembler-four-args.bin: 272 274 $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \
+18
tools/build/feature/test-libbfd-threadsafe.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <bfd.h> 3 + 4 + static bool lock(void *unused) 5 + { 6 + return true; 7 + } 8 + 9 + static bool unlock(void *unused) 10 + { 11 + return true; 12 + } 13 + 14 + int main(void) 15 + { 16 + /* Check for presence of new thread safety API (version 2.42) */ 17 + return !bfd_thread_init(lock, unlock, NULL); 18 + }
+5
tools/perf/Makefile.config
··· 935 935 $(call feature_check,libbfd) 936 936 $(call feature_check,disassembler-four-args) 937 937 $(call feature_check,disassembler-init-styled) 938 + $(call feature_check,libbfd-threadsafe) 938 939 $(call feature_check,libbfd-liberty) 939 940 $(call feature_check,libbfd-liberty-z) 941 + 942 + ifneq ($(feature-libbfd-threadsafe), 1) 943 + $(error binutils 2.42 or later is required for non-distro builds) 944 + endif 940 945 941 946 # we may be on a system that requires -liberty and (maybe) -lz 942 947 # to link against -lbfd; test each case individually here