All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: linux-perf-users@vger.kernel.org,
	Andi Kleen <andi@firstfloor.org>, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH] tools perf build: Support BUILD_NONDISTRO on OpenSUSE Tumbleweed
Date: Fri,  5 Sep 2025 11:38:32 -0700	[thread overview]
Message-ID: <20250905183832.3011694-1-andi@firstfloor.org> (raw)

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 <ak@linux.intel.com>
---
 tools/build/Makefile.feature |  4 +++-
 tools/build/feature/Makefile | 24 ++++++++++++++++++------
 tools/perf/Makefile.config   | 22 +++++++++++++++-------
 3 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 649c5ab8e8f2..46bdb9f8ba7f 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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.
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index b41a42818d8a..7fd30cbeefb0 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -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
 
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 5a5832ee7b53..53864a505cfa 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -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)
-- 
2.51.0


             reply	other threads:[~2025-09-05 18:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 18:38 Andi Kleen [this message]
2025-09-22 15:25 ` [PATCH] tools perf build: Support BUILD_NONDISTRO on OpenSUSE Tumbleweed Andi Kleen
2025-10-03 20:32 ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250905183832.3011694-1-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.