History

perf tools: Add an option to build without libbfd

Some distributions, like debian, don't link perf with libbfd. Add a build flag to make this configuration buildable and testable. This was inspired by: https://lore.kernel.org/linux-perf-users/20210910102307.2055484-1-tonyg@leastfixedpoint.com/T/#u

Ian Rogers committed 5 years ago

Commit 0d1c50a1 parent 4a86d411 file · +25 −22Browse files

Unified · Split

tools/perf/Makefile.config+25−22
@@ -827,33 +827,36 @@ else · 826 unmodified lines
827 endif827 endif
828endif828endif
829 829
830ifeq ($(feature-libbfd), 1)
831 EXTLIBS += -lbfd -lopcodes
832else
833 # we are on a system that requires -liberty and (maybe) -lz
834 # to link against -lbfd; test each case individually here
835
836 # call all detections now so we get correct
837 # status in VF output
838 $(call feature_check,libbfd-liberty)
839 $(call feature_check,libbfd-liberty-z)
840 830
841 ifeq ($(feature-libbfd-liberty), 1)831ifndef NO_LIBBFD
842 EXTLIBS += -lbfd -lopcodes -liberty832 ifeq ($(feature-libbfd), 1)
843 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl833 EXTLIBS += -lbfd -lopcodes
844 else834 else
845 ifeq ($(feature-libbfd-liberty-z), 1)835 # we are on a system that requires -liberty and (maybe) -lz
846 EXTLIBS += -lbfd -lopcodes -liberty -lz836 # to link against -lbfd; test each case individually here
847 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl837
838 # call all detections now so we get correct
839 # status in VF output
840 $(call feature_check,libbfd-liberty)
841 $(call feature_check,libbfd-liberty-z)
842
843 ifeq ($(feature-libbfd-liberty), 1)
844 EXTLIBS += -lbfd -lopcodes -liberty
845 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
846 else
847 ifeq ($(feature-libbfd-liberty-z), 1)
848 EXTLIBS += -lbfd -lopcodes -liberty -lz
849 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
850 endif
848 endif851 endif
852 $(call feature_check,disassembler-four-args)
849 endif853 endif
850 $(call feature_check,disassembler-four-args)
851endif
852 854
853ifeq ($(feature-libbfd-buildid), 1)855 ifeq ($(feature-libbfd-buildid), 1)
854 CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT856 CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
855else857 else
856 msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);858 msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);
859 endif
857endif860endif
858 861
859ifdef NO_DEMANGLE862ifdef NO_DEMANGLE