tools perf build: Support BUILD_NONDISTRO on OpenSUSE Tumbleweed
PATCH 1/1 tools perf build: Support BUILD_NONDISTRO on OpenSUSE Tumbleweed
My Tumbleweed system needs -lzstd -lsframe to build -lbfd for BUILD_NONDISTRO to get a sane BFD based setup. Add probing for that case.
The previously posted build fixes are also needed.
Signed-off-by Andi Kleen <[email protected]>
--- tools/build/Makefile.feature | 4 +++- tools/build/feature/Makefile | 24 ++++++++++++++++++------ tools/perf/Makefile.config | 22 +++++++++++++++------- 3 files changed, 36 insertions(+), 14 deletions(-)
tools/build/Makefile.feature +3 -1
@@ -120,6 +120,7 @@ FEATURE_TESTS_EXTRA := \ libcapstone \ libbfd-liberty \ libbfd-liberty-z \ + libbfd-liberty-z-zstd-sframe \ libopencsd \ cxx \ llvm \
@@ -159,7 +160,8 @@ FEATURE_DISPLAY ?= \ # Declare group members of a feature to display the logical OR of the detection # result instead of each member result. # -FEATURE_GROUP_MEMBERS-libbfd = libbfd-liberty libbfd-liberty-z +FEATURE_GROUP_MEMBERS-libbfd = libbfd-liberty libbfd-liberty-z \ + libbfd-liberty-z-zstd-sframe # # Declare list of feature dependency packages that provide pkg-config files.
tools/build/feature/Makefile +18 -6
@@ -20,6 +20,7 @@ FILES= \ test-reallocarray.bin \ test-libbfd-liberty.bin \ test-libbfd-liberty-z.bin \ + test-libbfd-liberty-z-zstd-sframe.bin \ test-cplus-demangle.bin \ test-cxa-demangle.bin \ test-libcap.bin \
@@ -118,7 +119,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$( ############################### $(OUTPUT)test-all.bin: - $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty + $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty || $(BUILD_ALL) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-hello.bin: $(BUILD)
@@ -278,15 +279,22 @@ $(OUTPUT)test-libbfd.bin: $(BUILD_BFD) $(OUTPUT)test-libbfd-buildid.bin: - $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz + $(BUILD_BFD) || \ + $(BUILD_BFD) -liberty || \ + $(BUILD_BFD) -liberty -lz || \ + $(BUILD_BFD) -liberty -lz -lzstd -sframe $(OUTPUT)test-disassembler-four-args.bin: - $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \ - $(BUILD_BFD) -lopcodes -liberty -lz + $(BUILD_BFD) -lopcodes || \ + $(BUILD_BFD) -lopcodes -liberty || \ + $(BUILD_BFD) -lopcodes -liberty -lz || \ + $(BUILD_BFD) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-disassembler-init-styled.bin: - $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \ - $(BUILD_BFD) -lopcodes -liberty -lz + $(BUILD_BFD) -lopcodes || \ + $(BUILD_BFD) -lopcodes -liberty || \ + $(BUILD_BFD) -lopcodes -liberty -lz || \ + $(BUILD_BFD) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-reallocarray.bin: $(BUILD)
@@ -297,6 +305,10 @@ $(OUTPUT)test-libbfd-liberty.bin: $(OUTPUT)test-libbfd-liberty-z.bin: $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz +$(OUTPUT)test-libbfd-liberty-z-zstd-sframe.bin: + $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz \ + -lzstd -lsframe + $(OUTPUT)test-cplus-demangle.bin: $(BUILD) -liberty
tools/perf/Makefile.config +15 -7
@@ -923,23 +923,31 @@ ifdef BUILD_NONDISTRO EXTLIBS += -lbfd -lopcodes else # we are on a system that requires -liberty and (maybe) -lz + # and possibly sframe and zstd # to link against -lbfd; test each case individually here # call all detections now so we get correct # status in VF output $(call feature_check,libbfd-liberty) $(call feature_check,libbfd-liberty-z) + $(call feature_check,libbfd-liberty-z-zstd-sframe) - ifeq ($(feature-libbfd-liberty), 1) + ifeq ($(feature-libbfd-liberty),$(feature-libbfd-liberty-z),1) EXTLIBS += -lbfd -lopcodes -liberty FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl - else - ifeq ($(feature-libbfd-liberty-z), 1) - EXTLIBS += -lbfd -lopcodes -liberty -lz - FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl - FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl - endif + endif + ifeq ($(feature-libbfd-liberty-z),1) + EXTLIBS += -lbfd -lopcodes -liberty -lz + FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl + FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl + endif + ifeq ($(feature-libbfd-liberty-z-zstd-sframe),1) + EXTLIBS += -lbfd -lopcodes -liberty -lz -lzstd -lsframe + FEATURE_CHECK_LDFLAGS-disassembler-four-args += \ + -liberty -lz -lzstd -lsframe -ldl + FEATURE_CHECK_LDFLAGS-disassembler-init-styled += \ + -liberty -lz -lzstd -lsframe -ldl endif $(call feature_check,disassembler-four-args) $(call feature_check,disassembler-init-styled)
Signature · 1 line
2.51.0
Quoted 7 lines · Andi Kleen
My Tumbleweed system needs -lzstd -lsframe to build -lbfd for
BUILD_NONDISTROto get a sane BFD based setup. Add probing for that case.The previously posted build fixes are also needed.
Signed-off-by Andi Kleen <[email protected]>
Patch still needs to be merged.
Thanks,
-Andi
Quoted 134 lines
--- tools/build/Makefile.feature | 4 +++- tools/build/feature/Makefile | 24 ++++++++++++++++++------ tools/perf/Makefile.config | 22 +++++++++++++++------- 3 files changed, 36 insertions(+), 14 deletions(-)tools/build/Makefile.feature +3
-1@@ -120,6 +120,7 @@ FEATURE_TESTS_EXTRA := \ libcapstone \ libbfd-liberty \ libbfd-liberty-z \ + libbfd-liberty-z-zstd-sframe \ libopencsd \ cxx \ llvm \@@ -159,7 +160,8 @@ FEATURE_DISPLAY ?= \ # Declare group members of a feature to display the logical OR of the detection # result instead of each member result. # -FEATURE_GROUP_MEMBERS-libbfd = libbfd-liberty libbfd-liberty-z +FEATURE_GROUP_MEMBERS-libbfd = libbfd-liberty libbfd-liberty-z \ + libbfd-liberty-z-zstd-sframe # # Declare list of feature dependency packages that provide pkg-config files.tools/build/feature/Makefile +18
-6@@ -20,6 +20,7 @@ FILES= \ test-reallocarray.bin \ test-libbfd-liberty.bin \ test-libbfd-liberty-z.bin \ + test-libbfd-liberty-z-zstd-sframe.bin \ test-cplus-demangle.bin \ test-cxa-demangle.bin \ test-libcap.bin \@@ -118,7 +119,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$( ############################### $(OUTPUT)test-all.bin: - $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty + $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty || $(BUILD_ALL) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-hello.bin: $(BUILD)@@ -278,15 +279,22 @@ $(OUTPUT)test-libbfd.bin: $(BUILD_BFD) $(OUTPUT)test-libbfd-buildid.bin: - $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz + $(BUILD_BFD) || \ + $(BUILD_BFD) -liberty || \ + $(BUILD_BFD) -liberty -lz || \ + $(BUILD_BFD) -liberty -lz -lzstd -sframe $(OUTPUT)test-disassembler-four-args.bin: - $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \ - $(BUILD_BFD) -lopcodes -liberty -lz + $(BUILD_BFD) -lopcodes || \ + $(BUILD_BFD) -lopcodes -liberty || \ + $(BUILD_BFD) -lopcodes -liberty -lz || \ + $(BUILD_BFD) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-disassembler-init-styled.bin: - $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \ - $(BUILD_BFD) -lopcodes -liberty -lz + $(BUILD_BFD) -lopcodes || \ + $(BUILD_BFD) -lopcodes -liberty || \ + $(BUILD_BFD) -lopcodes -liberty -lz || \ + $(BUILD_BFD) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-reallocarray.bin: $(BUILD)@@ -297,6 +305,10 @@ $(OUTPUT)test-libbfd-liberty.bin: $(OUTPUT)test-libbfd-liberty-z.bin: $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz +$(OUTPUT)test-libbfd-liberty-z-zstd-sframe.bin: + $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz \ + -lzstd -lsframe + $(OUTPUT)test-cplus-demangle.bin: $(BUILD) -libertytools/perf/Makefile.config +15
-7@@ -923,23 +923,31 @@ ifdef BUILD_NONDISTRO EXTLIBS += -lbfd -lopcodes else # we are on a system that requires -liberty and (maybe) -lz + # and possibly sframe and zstd # to link against -lbfd; test each case individually here # call all detections now so we get correct # status in VF output $(call feature_check,libbfd-liberty) $(call feature_check,libbfd-liberty-z) + $(call feature_check,libbfd-liberty-z-zstd-sframe) - ifeq ($(feature-libbfd-liberty), 1) + ifeq ($(feature-libbfd-liberty),$(feature-libbfd-liberty-z),1) EXTLIBS += -lbfd -lopcodes -liberty FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl - else - ifeq ($(feature-libbfd-liberty-z), 1) - EXTLIBS += -lbfd -lopcodes -liberty -lz - FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl - FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl - endif + endif + ifeq ($(feature-libbfd-liberty-z),1) + EXTLIBS += -lbfd -lopcodes -liberty -lz + FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl + FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl + endif + ifeq ($(feature-libbfd-liberty-z-zstd-sframe),1) + EXTLIBS += -lbfd -lopcodes -liberty -lz -lzstd -lsframe + FEATURE_CHECK_LDFLAGS-disassembler-four-args += \ + -liberty -lz -lzstd -lsframe -ldl + FEATURE_CHECK_LDFLAGS-disassembler-init-styled += \ + -liberty -lz -lzstd -lsframe -ldl endif $(call feature_check,disassembler-four-args) $(call feature_check,disassembler-init-styled)Signature · 1 line
2.51.0
Ping^2
-Andi
Quoted 141 lines · Andi Kleen
My Tumbleweed system needs -lzstd -lsframe to build -lbfd for
BUILD_NONDISTROto get a sane BFD based setup. Add probing for that case.The previously posted build fixes are also needed.
Signed-off-by Andi Kleen <[email protected]>--- tools/build/Makefile.feature | 4 +++- tools/build/feature/Makefile | 24 ++++++++++++++++++------ tools/perf/Makefile.config | 22 +++++++++++++++------- 3 files changed, 36 insertions(+), 14 deletions(-)tools/build/Makefile.feature +3
-1@@ -120,6 +120,7 @@ FEATURE_TESTS_EXTRA := \ libcapstone \ libbfd-liberty \ libbfd-liberty-z \ + libbfd-liberty-z-zstd-sframe \ libopencsd \ cxx \ llvm \@@ -159,7 +160,8 @@ FEATURE_DISPLAY ?= \ # Declare group members of a feature to display the logical OR of the detection # result instead of each member result. # -FEATURE_GROUP_MEMBERS-libbfd = libbfd-liberty libbfd-liberty-z +FEATURE_GROUP_MEMBERS-libbfd = libbfd-liberty libbfd-liberty-z \ + libbfd-liberty-z-zstd-sframe # # Declare list of feature dependency packages that provide pkg-config files.tools/build/feature/Makefile +18
-6@@ -20,6 +20,7 @@ FILES= \ test-reallocarray.bin \ test-libbfd-liberty.bin \ test-libbfd-liberty-z.bin \ + test-libbfd-liberty-z-zstd-sframe.bin \ test-cplus-demangle.bin \ test-cxa-demangle.bin \ test-libcap.bin \@@ -118,7 +119,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$( ############################### $(OUTPUT)test-all.bin: - $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty + $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty || $(BUILD_ALL) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-hello.bin: $(BUILD)@@ -278,15 +279,22 @@ $(OUTPUT)test-libbfd.bin: $(BUILD_BFD) $(OUTPUT)test-libbfd-buildid.bin: - $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz + $(BUILD_BFD) || \ + $(BUILD_BFD) -liberty || \ + $(BUILD_BFD) -liberty -lz || \ + $(BUILD_BFD) -liberty -lz -lzstd -sframe $(OUTPUT)test-disassembler-four-args.bin: - $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \ - $(BUILD_BFD) -lopcodes -liberty -lz + $(BUILD_BFD) -lopcodes || \ + $(BUILD_BFD) -lopcodes -liberty || \ + $(BUILD_BFD) -lopcodes -liberty -lz || \ + $(BUILD_BFD) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-disassembler-init-styled.bin: - $(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \ - $(BUILD_BFD) -lopcodes -liberty -lz + $(BUILD_BFD) -lopcodes || \ + $(BUILD_BFD) -lopcodes -liberty || \ + $(BUILD_BFD) -lopcodes -liberty -lz || \ + $(BUILD_BFD) -lopcodes -liberty -lz -lzstd -lsframe $(OUTPUT)test-reallocarray.bin: $(BUILD)@@ -297,6 +305,10 @@ $(OUTPUT)test-libbfd-liberty.bin: $(OUTPUT)test-libbfd-liberty-z.bin: $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz +$(OUTPUT)test-libbfd-liberty-z-zstd-sframe.bin: + $(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz \ + -lzstd -lsframe + $(OUTPUT)test-cplus-demangle.bin: $(BUILD) -libertytools/perf/Makefile.config +15
-7@@ -923,23 +923,31 @@ ifdef BUILD_NONDISTRO EXTLIBS += -lbfd -lopcodes else # we are on a system that requires -liberty and (maybe) -lz + # and possibly sframe and zstd # to link against -lbfd; test each case individually here # call all detections now so we get correct # status in VF output $(call feature_check,libbfd-liberty) $(call feature_check,libbfd-liberty-z) + $(call feature_check,libbfd-liberty-z-zstd-sframe) - ifeq ($(feature-libbfd-liberty), 1) + ifeq ($(feature-libbfd-liberty),$(feature-libbfd-liberty-z),1) EXTLIBS += -lbfd -lopcodes -liberty FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl - else - ifeq ($(feature-libbfd-liberty-z), 1) - EXTLIBS += -lbfd -lopcodes -liberty -lz - FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl - FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl - endif + endif + ifeq ($(feature-libbfd-liberty-z),1) + EXTLIBS += -lbfd -lopcodes -liberty -lz + FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl + FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl + endif + ifeq ($(feature-libbfd-liberty-z-zstd-sframe),1) + EXTLIBS += -lbfd -lopcodes -liberty -lz -lzstd -lsframe + FEATURE_CHECK_LDFLAGS-disassembler-four-args += \ + -liberty -lz -lzstd -lsframe -ldl + FEATURE_CHECK_LDFLAGS-disassembler-init-styled += \ + -liberty -lz -lzstd -lsframe -ldl endif $(call feature_check,disassembler-four-args) $(call feature_check,disassembler-init-styled)Signature · 1 line
2.51.0