summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-01-18 09:09:32 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-01-18 09:09:32 -0800
commitcee4757965003738533dbd408d61968d374409e2 (patch)
treeb503d99865d12e704f326b1645dd91a8267cf924
parent8562711ac09a6c0d8dd8868611c46f6145fa4d49 (diff)
parent436326bc525d467e38db1da576139ec5f28268c5 (diff)
Merge tag 'objtool-urgent-2026-01-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fixes from Ingo Molnar: "Fix two objtool build failures that trigger in uncommon build environments" * tag 'objtool-urgent-2026-01-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: fix build failure due to missing libopcodes check objtool: fix compilation failure with the x32 toolchain
-rw-r--r--tools/objtool/Makefile24
-rw-r--r--tools/objtool/include/objtool/warn.h4
2 files changed, 16 insertions, 12 deletions
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index ad6e1ec706ce..9b4503113ce5 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -72,23 +72,27 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
#
# To support disassembly, objtool needs libopcodes which is provided
-# with libbdf (binutils-dev or binutils-devel package).
+# with libbfd (binutils-dev or binutils-devel package).
#
-FEATURE_USER = .objtool
-FEATURE_TESTS = libbfd disassembler-init-styled
-FEATURE_DISPLAY =
-include $(srctree)/tools/build/Makefile.feature
+# We check using HOSTCC directly rather than the shared feature framework
+# because objtool is a host tool that links against host libraries.
+#
+HAVE_LIBOPCODES := $(shell echo 'int main(void) { return 0; }' | \
+ $(HOSTCC) -xc - -o /dev/null -lopcodes 2>/dev/null && echo y)
-ifeq ($(feature-disassembler-init-styled), 1)
- OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
-endif
+# Styled disassembler support requires binutils >= 2.39
+HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
+ $(HOSTCC) -E -xc - 2>/dev/null | grep -q disassembler_style && echo y)
BUILD_DISAS := n
-ifeq ($(feature-libbfd),1)
+ifeq ($(HAVE_LIBOPCODES),y)
BUILD_DISAS := y
- OBJTOOL_CFLAGS += -DDISAS -DPACKAGE="objtool"
+ OBJTOOL_CFLAGS += -DDISAS -DPACKAGE='"objtool"'
OBJTOOL_LDFLAGS += -lopcodes
+ifeq ($(HAVE_DISASM_STYLED),y)
+ OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
+endif
endif
export BUILD_DISAS
diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
index 25ff7942b4d5..2b27b54096b8 100644
--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -152,8 +152,8 @@ static inline void unindent(int *unused) { indent--; }
if (unlikely(insn->sym && insn->sym->pfunc && \
insn->sym->pfunc->debug_checksum)) { \
char *insn_off = offstr(insn->sec, insn->offset); \
- __dbg("checksum: %s %s %016lx", \
- func->name, insn_off, checksum); \
+ __dbg("checksum: %s %s %016llx", \
+ func->name, insn_off, (unsigned long long)checksum);\
free(insn_off); \
} \
})