public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] perf build: nondistro build tidyups
@ 2025-12-23 17:00 James Clark
  2025-12-23 17:00 ` [PATCH 1/5] perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting James Clark
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: James Clark @ 2025-12-23 17:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Leo Yan, Justin Stitt
  Cc: linux-perf-users, linux-kernel, Roberto Sassu, Alexei Starovoitov,
	Andres Freund, Andrii Nakryiko, Daniel Borkmann, John Fastabend,
	KP Singh, Martin KaFai Lau, Nick Terrell, Song Liu, bpf, llvm,
	Arnaldo Carvalho de Melo, James Clark, Nick Desaulniers,
	Quentin Monnet, Stanislav Fomichev

nondistro builds now require a specific version of libbfd, so this adds
an error when doing an explicit BUILD_NONDISTRO build and some other
related tidyups.

I'm not sure if the intention is to skip build-tests if something is
missing, but I see it was done for libbpf versions, so I added the same
for libbfd. This is the main thing that I hit, that build-test all of a
sudden stopped working for me.

The first commit is also a cherry pick of an old commit that seemed to
have been accidentally reverted in the unrelated change linked in the
trailers.

---
James Clark (4):
      perf build: Do all non-distro feature checks in one go
      perf build: Remove unused libbfd-buildid feature test
      perf build: Feature test for libbfd thread safety API
      perf build: Skip nondistro build test if libbfd is old

Roberto Sassu (1):
      perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting

 tools/build/Makefile.feature                 |  2 +-
 tools/build/feature/Makefile                 |  4 +--
 tools/build/feature/test-libbfd-buildid.c    |  8 -----
 tools/build/feature/test-libbfd-threadsafe.c | 18 ++++++++++
 tools/perf/Makefile.config                   | 54 ++++++++++------------------
 tools/perf/tests/make                        |  5 +++
 6 files changed, 45 insertions(+), 46 deletions(-)
---
base-commit: cbd41c6d4c26c161a2b0e70ad411d3885ff13507
change-id: 20251223-james-libbfd-feat-check-e0cd09d2c1e1

Best regards,
-- 
James Clark <james.clark@linaro.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting
  2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
@ 2025-12-23 17:00 ` James Clark
  2025-12-23 17:00 ` [PATCH 2/5] perf build: Do all non-distro feature checks in one go James Clark
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Clark @ 2025-12-23 17:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Leo Yan, Justin Stitt
  Cc: linux-perf-users, linux-kernel, Roberto Sassu, Alexei Starovoitov,
	Andres Freund, Andrii Nakryiko, Daniel Borkmann, John Fastabend,
	KP Singh, Martin KaFai Lau, Nick Terrell, Song Liu, bpf, llvm,
	Arnaldo Carvalho de Melo, James Clark, Nick Desaulniers,
	Quentin Monnet, Stanislav Fomichev

From: Roberto Sassu <roberto.sassu@huawei.com>

As the building mechanism is now able to retry detection with different
combinations of linking flags, setting
FEATURE_CHECK_LDFLAGS-disassembler-four-args and
FEATURE_CHECK_LDFLAGS-disassembler-init-styled is not necessary anymore,
so remove it.

Committer notes:

Use the same technique to find the set of bfd-related libraries to link as in:

  3308ffc5016e6136 ("tools, build: Retry detection of bfd-related features")

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Monnet <quentin@isovalent.com>
Cc: Song Liu <song@kernel.org>
Cc: Stanislav Fomichev <sdf@google.com>
Cc: bpf@vger.kernel.org
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20220719170555.2576993-3-roberto.sassu@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[Cherry pick to fix accidental removal in commit ad5f604e186a]
Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/perf/Makefile.config | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index bd9f4804d56b..ea6636a09a95 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -379,8 +379,8 @@ ifneq ($(TCMALLOC),)
 endif
 
 ifeq ($(FEATURES_DUMP),)
-# We will display at the end of this Makefile.config, using $(call feature_display_entries)
-# As we may retry some feature detection here, see the disassembler-four-args case, for instance
+# We will display at the end of this Makefile.config, using $(call feature_display_entries),
+# as we may retry some feature detection here.
   FEATURE_DISPLAY_DEFERRED := 1
 include $(srctree)/tools/build/Makefile.feature
 else
@@ -927,8 +927,6 @@ ifdef BUILD_NONDISTRO
 
   ifeq ($(feature-libbfd), 1)
     EXTLIBS += -lbfd -lopcodes
-    FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
-    FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
   else
     # we are on a system that requires -liberty and (maybe) -lz
     # to link against -lbfd; test each case individually here
@@ -940,13 +938,9 @@ ifdef BUILD_NONDISTRO
 
     ifeq ($(feature-libbfd-liberty), 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
     $(call feature_check,disassembler-four-args)
@@ -1324,6 +1318,6 @@ endif
 
 # re-generate FEATURE-DUMP as we may have called feature_check, found out
 # extra libraries to add to LDFLAGS of some other test and then redo those
-# tests, see the block about libbfd, disassembler-four-args, for instance.
+# tests.
 $(shell rm -f $(FEATURE_DUMP_FILENAME))
 $(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_assign,$(feat))" >> $(FEATURE_DUMP_FILENAME)))

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] perf build: Do all non-distro feature checks in one go
  2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
  2025-12-23 17:00 ` [PATCH 1/5] perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting James Clark
@ 2025-12-23 17:00 ` James Clark
  2025-12-23 17:00 ` [PATCH 3/5] perf build: Remove unused libbfd-buildid feature test James Clark
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Clark @ 2025-12-23 17:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Leo Yan, Justin Stitt
  Cc: linux-perf-users, linux-kernel, James Clark

None of the if statements or variable assignments in the non-distro
block actually affect the feature checks. Just do them all in one place
so the flow isn't obscured.

Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/perf/Makefile.config | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index ea6636a09a95..594fe3ecfee0 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -923,36 +923,28 @@ ifneq ($(NO_JEVENTS),1)
 endif
 
 ifdef BUILD_NONDISTRO
+  # call all detections now so we get correct status in VF output
   $(call feature_check,libbfd)
+  $(call feature_check,disassembler-four-args)
+  $(call feature_check,disassembler-init-styled)
+  $(call feature_check,libbfd-buildid)
+  $(call feature_check,libbfd-liberty)
+  $(call feature_check,libbfd-liberty-z)
 
+  # we may be on a system that requires -liberty and (maybe) -lz
+  # to link against -lbfd; test each case individually here
   ifeq ($(feature-libbfd), 1)
     EXTLIBS += -lbfd -lopcodes
-  else
-    # we are on a system that requires -liberty and (maybe) -lz
-    # 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)
-
-    ifeq ($(feature-libbfd-liberty), 1)
-      EXTLIBS += -lbfd -lopcodes -liberty
-    else
-      ifeq ($(feature-libbfd-liberty-z), 1)
-        EXTLIBS += -lbfd -lopcodes -liberty -lz
-      endif
-    endif
-    $(call feature_check,disassembler-four-args)
-    $(call feature_check,disassembler-init-styled)
+  else ifeq ($(feature-libbfd-liberty), 1)
+    EXTLIBS += -lbfd -lopcodes -liberty
+  else ifeq ($(feature-libbfd-liberty-z), 1)
+    EXTLIBS += -lbfd -lopcodes -liberty -lz
   endif
 
   CFLAGS += -DHAVE_LIBBFD_SUPPORT
   CXXFLAGS += -DHAVE_LIBBFD_SUPPORT
   $(call detected,CONFIG_LIBBFD)
 
-  $(call feature_check,libbfd-buildid)
-
   ifeq ($(feature-libbfd-buildid), 1)
     CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
   else

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] perf build: Remove unused libbfd-buildid feature test
  2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
  2025-12-23 17:00 ` [PATCH 1/5] perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting James Clark
  2025-12-23 17:00 ` [PATCH 2/5] perf build: Do all non-distro feature checks in one go James Clark
@ 2025-12-23 17:00 ` James Clark
  2025-12-23 17:00 ` [PATCH 4/5] perf build: Feature test for libbfd thread safety API James Clark
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Clark @ 2025-12-23 17:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Leo Yan, Justin Stitt
  Cc: linux-perf-users, linux-kernel, James Clark

HAVE_LIBBFD_BUILDID_SUPPORT isn't used in the codebase so remove the
feature test that sets it.

Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/build/Makefile.feature              | 1 -
 tools/build/feature/Makefile              | 4 ----
 tools/build/feature/test-libbfd-buildid.c | 8 --------
 tools/perf/Makefile.config                | 7 -------
 4 files changed, 20 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index a7f030fc5e83..20422853d1ac 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -71,7 +71,6 @@ FEATURE_TESTS_BASIC :=                  \
         gettid				\
         glibc                           \
         libbfd                          \
-        libbfd-buildid			\
         libelf                          \
         libelf-getphdrnum               \
         libelf-gelf_getnote             \
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 87a5a908d6fa..63a97cdf78a3 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -13,7 +13,6 @@ FILES=                                          \
          test-gtk2-infobar.bin                  \
          test-hello.bin                         \
          test-libbfd.bin                        \
-         test-libbfd-buildid.bin		\
          test-disassembler-four-args.bin        \
          test-disassembler-init-styled.bin	\
          test-reallocarray.bin			\
@@ -267,9 +266,6 @@ $(OUTPUT)test-libpython.bin:
 $(OUTPUT)test-libbfd.bin:
 	$(BUILD_BFD)
 
-$(OUTPUT)test-libbfd-buildid.bin:
-	$(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz
-
 $(OUTPUT)test-disassembler-four-args.bin:
 	$(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \
 	$(BUILD_BFD) -lopcodes -liberty -lz
diff --git a/tools/build/feature/test-libbfd-buildid.c b/tools/build/feature/test-libbfd-buildid.c
deleted file mode 100644
index 157644b04c05..000000000000
--- a/tools/build/feature/test-libbfd-buildid.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <bfd.h>
-
-int main(void)
-{
-	bfd *abfd = bfd_openr("Pedro", 0);
-	return abfd && (!abfd->build_id || abfd->build_id->size > 0x506564726f);
-}
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 594fe3ecfee0..5ff98b89c39a 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -927,7 +927,6 @@ ifdef BUILD_NONDISTRO
   $(call feature_check,libbfd)
   $(call feature_check,disassembler-four-args)
   $(call feature_check,disassembler-init-styled)
-  $(call feature_check,libbfd-buildid)
   $(call feature_check,libbfd-liberty)
   $(call feature_check,libbfd-liberty-z)
 
@@ -945,12 +944,6 @@ ifdef BUILD_NONDISTRO
   CXXFLAGS += -DHAVE_LIBBFD_SUPPORT
   $(call detected,CONFIG_LIBBFD)
 
-  ifeq ($(feature-libbfd-buildid), 1)
-    CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
-  else
-    $(warning Old version of libbfd/binutils things like PE executable profiling will not be available)
-  endif
-
   ifeq ($(feature-disassembler-four-args), 1)
     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
   endif

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] perf build: Feature test for libbfd thread safety API
  2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
                   ` (2 preceding siblings ...)
  2025-12-23 17:00 ` [PATCH 3/5] perf build: Remove unused libbfd-buildid feature test James Clark
@ 2025-12-23 17:00 ` James Clark
  2025-12-23 17:00 ` [PATCH 5/5] perf build: Skip nondistro build test if libbfd is old James Clark
  2026-01-06 22:18 ` [PATCH 0/5] perf build: nondistro build tidyups Arnaldo Carvalho de Melo
  5 siblings, 0 replies; 7+ messages in thread
From: James Clark @ 2025-12-23 17:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Leo Yan, Justin Stitt
  Cc: linux-perf-users, linux-kernel, James Clark

The non-distro build requires libbfd 2.42 since commit b72b8132d8fd
("perf libbfd: Ensure libbfd is initialized prior to use"). Add a
feature test so that it's obvious why the build fails if this criteria
isn't met.

Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/build/Makefile.feature                 |  1 +
 tools/build/feature/Makefile                 |  4 ++++
 tools/build/feature/test-libbfd-threadsafe.c | 18 ++++++++++++++++++
 tools/perf/Makefile.config                   |  5 +++++
 4 files changed, 28 insertions(+)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 20422853d1ac..d94548fff489 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -71,6 +71,7 @@ FEATURE_TESTS_BASIC :=                  \
         gettid				\
         glibc                           \
         libbfd                          \
+	libbfd-threadsafe		\
         libelf                          \
         libelf-getphdrnum               \
         libelf-gelf_getnote             \
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 63a97cdf78a3..731b19b84f4f 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -13,6 +13,7 @@ FILES=                                          \
          test-gtk2-infobar.bin                  \
          test-hello.bin                         \
          test-libbfd.bin                        \
+	 test-libbfd-threadsafe.bin      	\
          test-disassembler-four-args.bin        \
          test-disassembler-init-styled.bin	\
          test-reallocarray.bin			\
@@ -266,6 +267,9 @@ $(OUTPUT)test-libpython.bin:
 $(OUTPUT)test-libbfd.bin:
 	$(BUILD_BFD)
 
+$(OUTPUT)test-libbfd-threadsafe.bin:
+	$(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz
+
 $(OUTPUT)test-disassembler-four-args.bin:
 	$(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \
 	$(BUILD_BFD) -lopcodes -liberty -lz
diff --git a/tools/build/feature/test-libbfd-threadsafe.c b/tools/build/feature/test-libbfd-threadsafe.c
new file mode 100644
index 000000000000..fe97f95f6f06
--- /dev/null
+++ b/tools/build/feature/test-libbfd-threadsafe.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <bfd.h>
+
+static bool lock(void *unused)
+{
+	return true;
+}
+
+static bool unlock(void *unused)
+{
+	return true;
+}
+
+int main(void)
+{
+       /* Check for presence of new thread safety API (version 2.42) */
+       return !bfd_thread_init(lock, unlock, NULL);
+}
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 5ff98b89c39a..1e35fbb5215d 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -927,9 +927,14 @@ ifdef BUILD_NONDISTRO
   $(call feature_check,libbfd)
   $(call feature_check,disassembler-four-args)
   $(call feature_check,disassembler-init-styled)
+  $(call feature_check,libbfd-threadsafe)
   $(call feature_check,libbfd-liberty)
   $(call feature_check,libbfd-liberty-z)
 
+  ifneq ($(feature-libbfd-threadsafe), 1)
+    $(error binutils 2.42 or later is required for non-distro builds)
+  endif
+
   # we may be on a system that requires -liberty and (maybe) -lz
   # to link against -lbfd; test each case individually here
   ifeq ($(feature-libbfd), 1)

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] perf build: Skip nondistro build test if libbfd is old
  2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
                   ` (3 preceding siblings ...)
  2025-12-23 17:00 ` [PATCH 4/5] perf build: Feature test for libbfd thread safety API James Clark
@ 2025-12-23 17:00 ` James Clark
  2026-01-06 22:18 ` [PATCH 0/5] perf build: nondistro build tidyups Arnaldo Carvalho de Melo
  5 siblings, 0 replies; 7+ messages in thread
From: James Clark @ 2025-12-23 17:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Leo Yan, Justin Stitt
  Cc: linux-perf-users, linux-kernel, James Clark

Non distro builds now require a new version of libbfd, so skip the test
if the library is too old.

The grep test isn't a strong as the feature test in
test-libbfd-threadsafe.c, but there seems to be precedent for feature
testing this way here and it's good enough for the build-test rule. If
the function exists but returns an error it will be picked up by the
feature test when attempting the build.

Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/perf/tests/make | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 6641701e4828..36411b4b6d2b 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -124,6 +124,9 @@ make_minimal        += NO_LIBDW_DWARF_UNWIND=1 NO_LIBBPF=1
 make_minimal        += NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1
 make_minimal        += NO_LIBCAP=1 NO_CAPSTONE=1
 
+# binutils 2_42 and newer have bfd_thread_init()
+new_libbfd := $(shell echo '#include <bfd.h>' | $(CC) -E -x c - | grep bfd_thread_init)
+
 # $(run) contains all available tests
 run := make_pure
 # Targets 'clean all' can be run together only through top level
@@ -137,7 +140,9 @@ MAKE_F := $(MAKE) -f $(MK)
 endif
 run += make_python_perf_so
 run += make_debug
+ifneq ($(new_libbfd),)
 run += make_nondistro
+endif
 run += make_extra_tests
 run += make_jevents_all
 run += make_no_bpf_skel

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] perf build: nondistro build tidyups
  2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
                   ` (4 preceding siblings ...)
  2025-12-23 17:00 ` [PATCH 5/5] perf build: Skip nondistro build test if libbfd is old James Clark
@ 2026-01-06 22:18 ` Arnaldo Carvalho de Melo
  5 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-01-06 22:18 UTC (permalink / raw)
  To: James Clark
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Nathan Chancellor, Nick Desaulniers, Bill Wendling, Leo Yan,
	Justin Stitt, linux-perf-users, linux-kernel, Roberto Sassu,
	Alexei Starovoitov, Andres Freund, Andrii Nakryiko,
	Daniel Borkmann, John Fastabend, KP Singh, Martin KaFai Lau,
	Nick Terrell, Song Liu, bpf, llvm, Arnaldo Carvalho de Melo,
	Quentin Monnet, Stanislav Fomichev

On Tue, Dec 23, 2025 at 05:00:23PM +0000, James Clark wrote:
> nondistro builds now require a specific version of libbfd, so this adds
> an error when doing an explicit BUILD_NONDISTRO build and some other
> related tidyups.
> 
> I'm not sure if the intention is to skip build-tests if something is
> missing, but I see it was done for libbpf versions, so I added the same
> for libbfd. This is the main thing that I hit, that build-test all of a
> sudden stopped working for me.
> 
> The first commit is also a cherry pick of an old commit that seemed to
> have been accidentally reverted in the unrelated change linked in the
> trailers.

Thanks, applied to perf-tools-next,

- Arnaldo
 
> ---
> James Clark (4):
>       perf build: Do all non-distro feature checks in one go
>       perf build: Remove unused libbfd-buildid feature test
>       perf build: Feature test for libbfd thread safety API
>       perf build: Skip nondistro build test if libbfd is old
> 
> Roberto Sassu (1):
>       perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting
> 
>  tools/build/Makefile.feature                 |  2 +-
>  tools/build/feature/Makefile                 |  4 +--
>  tools/build/feature/test-libbfd-buildid.c    |  8 -----
>  tools/build/feature/test-libbfd-threadsafe.c | 18 ++++++++++
>  tools/perf/Makefile.config                   | 54 ++++++++++------------------
>  tools/perf/tests/make                        |  5 +++
>  6 files changed, 45 insertions(+), 46 deletions(-)
> ---
> base-commit: cbd41c6d4c26c161a2b0e70ad411d3885ff13507
> change-id: 20251223-james-libbfd-feat-check-e0cd09d2c1e1
> 
> Best regards,
> -- 
> James Clark <james.clark@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-01-06 22:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-23 17:00 [PATCH 0/5] perf build: nondistro build tidyups James Clark
2025-12-23 17:00 ` [PATCH 1/5] perf build: Remove FEATURE_CHECK_LDFLAGS-disassembler-{four-args,init-styled} setting James Clark
2025-12-23 17:00 ` [PATCH 2/5] perf build: Do all non-distro feature checks in one go James Clark
2025-12-23 17:00 ` [PATCH 3/5] perf build: Remove unused libbfd-buildid feature test James Clark
2025-12-23 17:00 ` [PATCH 4/5] perf build: Feature test for libbfd thread safety API James Clark
2025-12-23 17:00 ` [PATCH 5/5] perf build: Skip nondistro build test if libbfd is old James Clark
2026-01-06 22:18 ` [PATCH 0/5] perf build: nondistro build tidyups Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox