diff options
Diffstat (limited to 'tools/perf/Makefile.config')
| -rw-r--r-- | tools/perf/Makefile.config | 132 |
1 files changed, 59 insertions, 73 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 2916d59c88cd..a148ca9efca9 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -28,63 +28,58 @@ include $(srctree)/tools/scripts/Makefile.arch $(call detected_var,SRCARCH) -ifneq ($(NO_SYSCALL_TABLE),1) - NO_SYSCALL_TABLE := 1 - - ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 powerpc arm64 s390 mips loongarch riscv)) - NO_SYSCALL_TABLE := 0 - endif - - ifneq ($(NO_SYSCALL_TABLE),1) - CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT - endif -endif +CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated # Additional ARCH settings for ppc ifeq ($(SRCARCH),powerpc) - CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated - LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS := -lunwind -lunwind-ppc64 + endif endif # Additional ARCH settings for x86 ifeq ($(SRCARCH),x86) $(call detected,CONFIG_X86) - CFLAGS += -I$(OUTPUT)arch/x86/include/generated ifeq (${IS_64_BIT}, 1) CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S - LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma + endif $(call detected,CONFIG_X86_64) else - LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind + endif endif endif ifeq ($(SRCARCH),arm) - LIBUNWIND_LIBS = -lunwind -lunwind-arm + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS = -lunwind -lunwind-arm + endif endif ifeq ($(SRCARCH),arm64) - CFLAGS += -I$(OUTPUT)arch/arm64/include/generated - LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS = -lunwind -lunwind-aarch64 + endif endif ifeq ($(SRCARCH),loongarch) - CFLAGS += -I$(OUTPUT)arch/loongarch/include/generated - LIBUNWIND_LIBS = -lunwind -lunwind-loongarch64 + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS = -lunwind -lunwind-loongarch64 + endif endif ifeq ($(ARCH),s390) - CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated + CFLAGS += -fPIC endif ifeq ($(ARCH),mips) - CFLAGS += -I$(OUTPUT)arch/mips/include/generated - LIBUNWIND_LIBS = -lunwind -lunwind-mips -endif - -ifeq ($(ARCH),riscv) - CFLAGS += -I$(OUTPUT)arch/riscv/include/generated + ifndef NO_LIBUNWIND + LIBUNWIND_LIBS = -lunwind -lunwind-mips + endif endif # So far there's only x86 and arm libdw unwind support merged in perf. @@ -121,16 +116,18 @@ ifdef LIBUNWIND_DIR $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch))) endif -# Set per-feature check compilation flags -FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS) -FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) -FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS) -FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) - -FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm -FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64 -FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86 -FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64 +ifndef NO_LIBUNWIND + # Set per-feature check compilation flags + FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS) + FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) + FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS) + FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) + + FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm + FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64 + FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86 + FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64 +endif FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto @@ -155,7 +152,7 @@ ifdef LIBDW_DIR endif DWARFLIBS := -ldw ifeq ($(findstring -static,${LDFLAGS}),-static) - DWARFLIBS += -lelf -lz -llzma -lbz2 -lzstd + DWARFLIBS += -lelf -lz -llzma -lbz2 LIBDW_VERSION := $(shell $(PKG_CONFIG) --modversion libdw).0.0 LIBDW_VERSION_1 := $(word 1, $(subst ., ,$(LIBDW_VERSION))) @@ -550,6 +547,12 @@ ifndef NO_LIBELF CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT endif + ifeq ($(feature-libelf-zstd), 1) + ifdef NO_LIBZSTD + $(error Error: libzstd is required by libelf, please do not set NO_LIBZSTD) + endif + endif + ifndef NO_LIBDEBUGINFOD $(call feature_check,libdebuginfod) ifeq ($(feature-libdebuginfod), 1) @@ -734,26 +737,25 @@ ifeq ($(dwarf-post-unwind),1) $(call detected,CONFIG_DWARF_UNWIND) endif -ifndef NO_LOCAL_LIBUNWIND - ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64)) - $(call feature_check,libunwind-debug-frame) - ifneq ($(feature-libunwind-debug-frame), 1) - $(warning No debug_frame support found in libunwind) +ifndef NO_LIBUNWIND + ifndef NO_LOCAL_LIBUNWIND + ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64)) + $(call feature_check,libunwind-debug-frame) + ifneq ($(feature-libunwind-debug-frame), 1) + $(warning No debug_frame support found in libunwind) + CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME + endif + else + # non-ARM has no dwarf_find_debug_frame() function: CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME endif - else - # non-ARM has no dwarf_find_debug_frame() function: - CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME + EXTLIBS += $(LIBUNWIND_LIBS) + LDFLAGS += $(LIBUNWIND_LIBS) + endif + ifeq ($(findstring -static,${LDFLAGS}),-static) + # gcc -static links libgcc_eh which contans piece of libunwind + LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition endif - EXTLIBS += $(LIBUNWIND_LIBS) - LDFLAGS += $(LIBUNWIND_LIBS) -endif -ifeq ($(findstring -static,${LDFLAGS}),-static) - # gcc -static links libgcc_eh which contans piece of libunwind - LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition -endif - -ifndef NO_LIBUNWIND CFLAGS += -DHAVE_LIBUNWIND_SUPPORT CFLAGS += $(LIBUNWIND_CFLAGS) LDFLAGS += $(LIBUNWIND_LDFLAGS) @@ -761,21 +763,7 @@ ifndef NO_LIBUNWIND endif ifneq ($(NO_LIBTRACEEVENT),1) - ifeq ($(NO_SYSCALL_TABLE),0) - $(call detected,CONFIG_TRACE) - else - ifndef NO_LIBAUDIT - $(call feature_check,libaudit) - ifneq ($(feature-libaudit), 1) - $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev) - NO_LIBAUDIT := 1 - else - CFLAGS += -DHAVE_LIBAUDIT_SUPPORT - EXTLIBS += -laudit - $(call detected,CONFIG_TRACE) - endif - endif - endif + $(call detected,CONFIG_TRACE) endif ifndef NO_LIBCRYPTO @@ -1172,7 +1160,6 @@ endif # libtraceevent is a recommended dependency picked up from the system. ifneq ($(NO_LIBTRACEEVENT),1) - $(call feature_check,libtraceevent) ifeq ($(feature-libtraceevent), 1) CFLAGS += -DHAVE_LIBTRACEEVENT $(shell $(PKG_CONFIG) --cflags libtraceevent) LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libtraceevent) @@ -1188,7 +1175,6 @@ ifneq ($(NO_LIBTRACEEVENT),1) $(error ERROR: libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel and/or set LIBTRACEEVENT_DIR or build with NO_LIBTRACEEVENT=1) endif - $(call feature_check,libtracefs) ifeq ($(feature-libtracefs), 1) CFLAGS += $(shell $(PKG_CONFIG) --cflags libtracefs) LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libtracefs) |
