diff options
| author | Sasha Levin <sashal@kernel.org> | 2025-12-23 07:03:57 -0500 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-01-13 11:37:51 +0100 |
| commit | 436326bc525d467e38db1da576139ec5f28268c5 (patch) | |
| tree | d5ab70a958a306d6fb2743091d1ff8a8a3ee765f /tools/perf/scripts/python/bin/git@git.tavy.me:linux.git | |
| parent | 26bea10450afe5ad4dd0e0bbb797c44e1df110fe (diff) | |
objtool: fix build failure due to missing libopcodes check
Commit 59953303827e ("objtool: Disassemble code with libopcodes instead
of running objdump") added support for using libopcodes for disassembly.
However, the feature detection checks for libbfd availability but then
unconditionally links against libopcodes:
ifeq ($(feature-libbfd),1)
OBJTOOL_LDFLAGS += -lopcodes
endif
This causes build failures in environments where libbfd is installed but
libopcodes is not, since the test-libbfd.c feature test only links
against -lbfd and -ldl, not -lopcodes:
/usr/bin/ld: cannot find -lopcodes: No such file or directory
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:109: objtool] Error 1
Additionally, the shared feature framework uses $(CC) which is the
cross-compiler in cross-compilation builds. Since objtool is a host tool
that links with $(HOSTCC) against host libraries, the feature detection
can falsely report libopcodes as available when the cross-compiler's
sysroot has it but the host system doesn't.
Fix this by replacing the feature framework check with a direct inline
test that uses $(HOSTCC) to compile and link a test program against
libopcodes, similar to how xxhash availability is detected.
Fixes: 59953303827e ("objtool: Disassemble code with libopcodes instead of running objdump")
Assisted-by: claude-opus-4-5-20251101
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251223120357.2492008-1-sashal@kernel.org
Diffstat (limited to 'tools/perf/scripts/python/bin/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
