libiberty is license incompatible with perf and building requires the BUILD_NONDISTRO=1 build flag. libiberty is used for HAVE_CPLUS_DEMANGLE_SUPPORT. Remove the code to simplify the code base as it can't be distributed. Remove the BUILD_NONDISTRO build flag and test as they no longer enable/disable support. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 12 ------------ tools/perf/Makefile.perf | 11 ++++------- tools/perf/tests/make | 2 -- tools/perf/util/demangle-cxx.cpp | 13 +------------ tools/perf/util/symbol-elf.c | 7 ------- tools/perf/util/symbol.c | 6 ------ 6 files changed, 5 insertions(+), 46 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index b63c952b10ce..7bc9985264a7 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -954,18 +954,6 @@ ifndef NO_DEMANGLE CXXFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT $(call detected,CONFIG_CXX_DEMANGLE) endif - ifdef BUILD_NONDISTRO - ifeq ($(filter -liberty,$(EXTLIBS)),) - $(call feature_check,cplus-demangle) - ifeq ($(feature-cplus-demangle), 1) - EXTLIBS += -liberty - endif - endif - ifneq ($(filter -liberty,$(EXTLIBS)),) - CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT - CXXFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT - endif - endif endif ifndef NO_LZMA diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 116c935c06f7..727b7412aab0 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -120,9 +120,6 @@ include ../scripts/utilities.mak # # Set BUILD_BPF_SKEL to 0 to override BUILD_BPF_SKEL and not build BPF skeletons # -# Define BUILD_NONDISTRO to enable building an linking against libbfd and -# libiberty distribution license incompatible libraries. -# # Define EXTRA_TESTS to enable building extra tests useful mainly to perf # developers, such as: # x86 instruction decoder - new instructions test @@ -297,10 +294,10 @@ LIBSYMBOL_DIR = $(srctree)/tools/lib/symbol/ LIBPERF_DIR = $(srctree)/tools/lib/perf/ DOC_DIR = $(srctree)/tools/perf/Documentation/ -# Set FEATURE_TESTS to 'all' so all possible feature checkers are executed. -# Without this setting the output feature dump file misses some features, for -# example, liberty. Select all checkers so we won't get an incomplete feature -# dump file. +# Set FEATURE_TESTS to 'all' so all possible feature checkers are +# executed. Without this setting the output feature dump file misses +# some features. Select all checkers so we won't get an incomplete +# feature dump file. ifeq ($(config),1) ifdef MAKECMDGOALS ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump) diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 301cda63a27f..112423076e1c 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -68,7 +68,6 @@ python_perf_so := $(shell $(MAKE) python_perf_target|grep "Target is:"|awk '{pri make_clean_all := clean all make_python_perf_so := $(python_perf_so) make_debug := DEBUG=1 -make_nondistro := BUILD_NONDISTRO=1 make_extra_tests := EXTRA_TESTS=1 make_jevents_all := JEVENTS_ARCH=all make_no_bpf_skel := BUILD_BPF_SKEL=0 @@ -139,7 +138,6 @@ MAKE_F := $(MAKE) -f $(MK) endif run += make_python_perf_so run += make_debug -run += make_nondistro run += make_extra_tests run += make_jevents_all run += make_no_bpf_skel diff --git a/tools/perf/util/demangle-cxx.cpp b/tools/perf/util/demangle-cxx.cpp index bd657eb37efc..36801ea327a6 100644 --- a/tools/perf/util/demangle-cxx.cpp +++ b/tools/perf/util/demangle-cxx.cpp @@ -8,13 +8,6 @@ #include #endif -#if defined(HAVE_CPLUS_DEMANGLE_SUPPORT) -#ifndef DMGL_PARAMS -#define DMGL_PARAMS (1 << 0) /* Include function args */ -#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ -#endif -#endif - /* * Demangle C++ function signature * @@ -24,11 +17,7 @@ extern "C" char *cxx_demangle_sym(const char *str, bool params __maybe_unused, bool modifiers __maybe_unused) { -#if defined(HAVE_CPLUS_DEMANGLE_SUPPORT) - int flags = (params ? DMGL_PARAMS : 0) | (modifiers ? DMGL_ANSI : 0); - - return cplus_demangle(str, flags); -#elif defined(HAVE_CXA_DEMANGLE_SUPPORT) +#if defined(HAVE_CXA_DEMANGLE_SUPPORT) char *output; int status; diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index c6013f9fdc1a..b17386372882 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -24,13 +24,6 @@ #include #include -#if defined(HAVE_CPLUS_DEMANGLE_SUPPORT) -#ifndef DMGL_PARAMS -#define DMGL_PARAMS (1 << 0) /* Include function args */ -#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ -#endif -#endif - #ifndef EM_AARCH64 #define EM_AARCH64 183 /* ARM 64 bit */ #endif diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index c058d6a01509..0d1220e12205 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -2535,13 +2535,7 @@ static bool want_demangle(bool is_kernel_sym) char *cxx_demangle_sym(const char *str __maybe_unused, bool params __maybe_unused, bool modifiers __maybe_unused) { -#if defined(HAVE_CPLUS_DEMANGLE_SUPPORT) - int flags = (params ? DMGL_PARAMS : 0) | (modifiers ? DMGL_ANSI : 0); - - return cplus_demangle(str, flags); -#else return NULL; -#endif } #endif /* !HAVE_CXA_DEMANGLE_SUPPORT */ -- 2.51.0.rc2.233.g662b1ed5c5-goog