* [PATCH 1/1] perf build: Don't fail fast path feature detection when binutils-devel is not available
@ 2025-11-13 0:57 Arnaldo Carvalho de Melo
2025-11-13 3:24 ` Ian Rogers
0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-11-13 0:57 UTC (permalink / raw)
To: Namhyung Kim
Cc: Adrian Hunter, Ian Rogers, James Clark, Jiri Olsa, linux-kernel,
linux-perf-users
tldr; Just FYI, I'm carrying this on the perf tools tree.
This is one more remnant of the BUILD_NONDISTRO series to make building
with binutils-devel opt-in due to license incompatibility.
In this case just the references at link time were still in place, which
make building the test-all.bin file fail, which wasn't detected before
probably because the last test was done with binutils-devel available,
doh.
Now:
$ rpm -q binutils-devel
package binutils-devel is not installed
$ file /tmp/build/perf-tools/feature/test-all.bin
/tmp/build/perf-tools/feature/test-all.bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
BuildID[sha1]=4b5388a346b51f1b993f0b0dbd49f4570769b03c, for GNU/Linux 3.2.0, not stripped
$
Fixes: 970ae86307718c34 ("perf build: The bfd features are opt-in, stop testing for them by default")
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/feature/Makefile | 4 ++--
tools/perf/Makefile.config | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 49b0add392b1c11a..95646290cb89cda3 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -107,7 +107,7 @@ all: $(FILES)
__BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
BUILD_BFD = $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
- BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd
+ BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -ldl -lz -llzma -lzstd
__BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
@@ -115,7 +115,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
###############################
$(OUTPUT)test-all.bin:
- $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty
+ $(BUILD_ALL)
$(OUTPUT)test-hello.bin:
$(BUILD)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 5700516aa84aec2c..2dd5f5a60568d002 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -354,9 +354,6 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
FEATURE_CHECK_LDFLAGS-libaio = -lrt
-FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
-FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
-
CORE_CFLAGS += -fno-omit-frame-pointer
CORE_CFLAGS += -Wall
CORE_CFLAGS += -Wextra
@@ -930,6 +927,8 @@ 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
--
2.51.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] perf build: Don't fail fast path feature detection when binutils-devel is not available
2025-11-13 0:57 [PATCH 1/1] perf build: Don't fail fast path feature detection when binutils-devel is not available Arnaldo Carvalho de Melo
@ 2025-11-13 3:24 ` Ian Rogers
0 siblings, 0 replies; 2+ messages in thread
From: Ian Rogers @ 2025-11-13 3:24 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Namhyung Kim, Adrian Hunter, James Clark, Jiri Olsa, linux-kernel,
linux-perf-users
On Wed, Nov 12, 2025 at 4:57 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> tldr; Just FYI, I'm carrying this on the perf tools tree.
>
> This is one more remnant of the BUILD_NONDISTRO series to make building
> with binutils-devel opt-in due to license incompatibility.
>
> In this case just the references at link time were still in place, which
> make building the test-all.bin file fail, which wasn't detected before
> probably because the last test was done with binutils-devel available,
> doh.
>
> Now:
>
> $ rpm -q binutils-devel
> package binutils-devel is not installed
> $ file /tmp/build/perf-tools/feature/test-all.bin
> /tmp/build/perf-tools/feature/test-all.bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
> dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
> BuildID[sha1]=4b5388a346b51f1b993f0b0dbd49f4570769b03c, for GNU/Linux 3.2.0, not stripped
> $
>
> Fixes: 970ae86307718c34 ("perf build: The bfd features are opt-in, stop testing for them by default")
> Cc: Ian Rogers <irogers@google.com>
> Cc: James Clark <james.clark@linaro.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Lgtm.
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
Ian
> ---
> tools/build/feature/Makefile | 4 ++--
> tools/perf/Makefile.config | 5 ++---
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 49b0add392b1c11a..95646290cb89cda3 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -107,7 +107,7 @@ all: $(FILES)
> __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
> BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
> BUILD_BFD = $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
> - BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd
> + BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -ldl -lz -llzma -lzstd
>
> __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
> BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
> @@ -115,7 +115,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
> ###############################
>
> $(OUTPUT)test-all.bin:
> - $(BUILD_ALL) || $(BUILD_ALL) -lopcodes -liberty
> + $(BUILD_ALL)
>
> $(OUTPUT)test-hello.bin:
> $(BUILD)
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index 5700516aa84aec2c..2dd5f5a60568d002 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -354,9 +354,6 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
>
> FEATURE_CHECK_LDFLAGS-libaio = -lrt
>
> -FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
> -FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
> -
> CORE_CFLAGS += -fno-omit-frame-pointer
> CORE_CFLAGS += -Wall
> CORE_CFLAGS += -Wextra
> @@ -930,6 +927,8 @@ 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
> --
> 2.51.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-13 3:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 0:57 [PATCH 1/1] perf build: Don't fail fast path feature detection when binutils-devel is not available Arnaldo Carvalho de Melo
2025-11-13 3:24 ` Ian Rogers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).