From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Quentin Monnet <qmo@kernel.org>,
Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
James Clark <james.clark@linaro.org>, Leo Yan <leo.yan@arm.com>,
linux-perf-users@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 4/4] objtool: Add explicitly sequenced -lzstd to libopcodes fallback
Date: Tue, 3 Nov 2026 20:30:06 -0800 [thread overview]
Message-ID: <20261104043006.1199857-5-irogers@google.com> (raw)
In-Reply-To: <20261104043006.1199857-1-irogers@google.com>
Distributions like Fedora ship a statically compiled binutils libbfd (an
intrinsic dependency of libopcodes) that uses zstd to decompress
sections.
Because objtool resolves host dependencies sequentially via a manual
HOSTCC shell loop, linking against static binutils fails with undefined
references to 'ZSTD_decompress' unless the loop probes for -lzstd.
Add the '-lopcodes -lbfd -liberty -lz -lzstd' combination to the
LIBOPCODES_LIBS fallback chain.
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/objtool/Makefile | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index db99c4759b2c..238da6fd277f 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -81,14 +81,15 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
#
# When using shared libraries, -lopcodes is sufficient as dependencies are
# resolved automatically. With static libraries, we must explicitly link
-# against libopcodes' dependencies: libbfd, libiberty, and sometimes libz.
-# Try each combination and use the first one that succeeds.
+# against libopcodes' dependencies: libbfd, libiberty, and sometimes libz
+# and libzstd. Try each combination and use the first one that succeeds.
#
LIBOPCODES_LIBS := $(shell \
for libs in "-lopcodes" \
"-lopcodes -lbfd" \
"-lopcodes -lbfd -liberty" \
- "-lopcodes -lbfd -liberty -lz"; do \
+ "-lopcodes -lbfd -liberty -lz" \
+ "-lopcodes -lbfd -liberty -lz -lzstd"; do \
printf '%s\n' \
'$(pound)include <bfd.h>' \
'$(pound)include <dis-asm.h>' \
--
2.56.0.385.gac671c819a-goog
prev parent reply other threads:[~2026-11-04 4:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 4:30 [PATCH v3 0/4] tools build: Fixes for libbfd -lzstd dependency Ian Rogers
2026-11-04 4:30 ` [PATCH v3 1/4] tools build: Add explicitly sequenced -lzstd to libbfd feature fallback Ian Rogers
2026-11-04 5:03 ` bot+bpf-ci
2026-11-04 4:30 ` [PATCH v3 2/4] perf " Ian Rogers
2026-11-04 4:30 ` [PATCH v3 3/4] bpftool: " Ian Rogers
2026-11-04 4:30 ` Ian Rogers [this message]
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=20261104043006.1199857-5-irogers@google.com \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=qmo@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®