mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux regressions mailing list <regressions@lists.linux.dev>,
	irogers@google.com
Subject: Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
Date: Tue, 20 Jan 2026 11:28:32 +0100	[thread overview]
Message-ID: <20260120102832.GJ1890602@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAJZ5v0gkhSxWZ9wTY+2AGDCtZgSKmOwpg7Np9OVDMJptqnntUQ@mail.gmail.com>

On Mon, Jan 19, 2026 at 09:19:31PM +0100, Rafael J. Wysocki wrote:
> Hi Sasha,
> 
> Commit 436326bc525d ("objtool: fix build failure due to missing
> libopcodes check") breaks kernel build for me.
> 
> Here's what I get when I try to build the kernel after that commit:
> 
>   LD      /scratch/rafael/work/build/xps13/tools/objtool/objtool-in.o
>   LINK    /scratch/rafael/work/build/xps13/tools/objtool/objtool
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld:
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../lib64/libopcodes.a(aarch64-dis.o):
> in function `print_operands':
> /home/abuild/rpmbuild/BUILD/binutils-2.45/build-dir/opcodes/../../opcodes/aarch64-dis.c:3945:(.text+0x6317):
> undefined reference to `xmalloc'
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld:
> /home/abuild/rpmbuild/BUILD/binutils-2.45/build-dir/opcodes/../../opcodes/aarch64-dis.c:3992:(.text+0x6723):
> undefined reference to `_sch_istable'
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld:
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../lib64/libopcodes.a(aarch64-dis.o):
> in function `print_insn_aarch64':
> /home/abuild/rpmbuild/BUILD/binutils-2.45/build-dir/opcodes/../../opcodes/aarch64-dis.c:4559:(.text+0x6b1e):
> undefined reference to `bfd_get_bits'
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld:
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../lib64/libopcodes.a(aarch64-dis.o):
> in function `parse_aarch64_dis_option':
> /home/abuild/rpmbuild/BUILD/binutils-2.45/build-dir/opcodes/../../opcodes/aarch64-dis.c:103:(.text+0x6dea):
> undefined reference to `_bfd_error_handler'
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld:
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../lib64/libopcodes.a(aarch64-opc.o):
> in function `init_insn_sequence':
> /home/abuild/rpmbuild/BUILD/binutils-2.45/build-dir/opcodes/../../opcodes/aarch64-opc.c:5561:(.text+0x5c06):
> undefined reference to `xcalloc'
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld:
> /usr/lib64/gcc/x86_64-suse-linux/15/../../../../lib64/libopcodes.a(disassemble.o):
> in function `remove_whitespace_and_extra_commas':
> /home/abuild/rpmbuild/BUILD/binutils-2.45/build-dir/opcodes/../../opcodes/disassemble.c:801:(.text+0x346):
> undefined reference to `_sch_istable'
> ...
> 
> (many more similar messages skipped).
> 
> Reverting commit 436326bc525d makes the problem go away.

Bah, I hate makefiles.

Anyway, the below is that revert + adding an explicit libbfd-opcodes
feature test.

Did I do this right? Josh, Arnaldo, could you comment on that CC vs
HOSTCC issue that Sasha mentioned?

---
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 362cf8f4a0a0..4d93375a6474 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -117,6 +117,7 @@ FEATURE_TESTS_EXTRA :=                  \
          libcapstone                    \
          libbfd-liberty                 \
          libbfd-liberty-z               \
+         libbfd-opcodes                 \
          libopencsd                     \
          libperl                        \
          cxx                            \
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 0d5a15654b17..4a9fc7a1b2ed 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -19,6 +19,7 @@ FILES=                                          \
          test-reallocarray.bin			\
          test-libbfd-liberty.bin                \
          test-libbfd-liberty-z.bin              \
+         test-libbfd-opcodes.bin                \
          test-cplus-demangle.bin                \
          test-cxa-demangle.bin                  \
          test-libcap.bin			\
@@ -288,6 +289,9 @@ endif
 $(OUTPUT)test-libbfd-liberty-z.bin:
 	$(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
 
+$(OUTPUT)test-libbfd-opcodes.bin:
+	$(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c $(LDFLAGS) -lbfd -ldl -lopcodes
+
 $(OUTPUT)test-cplus-demangle.bin:
 	$(BUILD) -liberty
 
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 9b4503113ce5..5b85652cbfd7 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -72,27 +72,23 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
 
 #
 # To support disassembly, objtool needs libopcodes which is provided
-# with libbfd (binutils-dev or binutils-devel package).
+# with libbdf (binutils-dev or binutils-devel package).
 #
-# 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)
+FEATURE_USER = .objtool
+FEATURE_TESTS = libbfd-opcodes disassembler-init-styled
+FEATURE_DISPLAY =
+include $(srctree)/tools/build/Makefile.feature
 
-# 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)
+ifeq ($(feature-disassembler-init-styled), 1)
+	OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
+endif
 
 BUILD_DISAS := n
 
-ifeq ($(HAVE_LIBOPCODES),y)
+ifeq ($(feature-libbfd-opcodes),1)
 	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

  reply	other threads:[~2026-01-20 10:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 20:19 Rafael J. Wysocki
2026-01-20 10:28 ` Peter Zijlstra [this message]
2026-01-20 17:40   ` Sasha Levin
2026-01-20 18:29     ` Rafael J. Wysocki
2026-01-20 19:58       ` Sasha Levin
2026-01-20 20:04         ` Rafael J. Wysocki
2026-01-20 20:22           ` Sasha Levin
2026-01-20 21:33             ` Rafael J. Wysocki
2026-01-21  1:18               ` Sasha Levin
2026-01-21  5:29                 ` Josh Poimboeuf
2026-01-21 12:06                   ` Sasha Levin
2026-01-21 16:25                     ` [PATCH] objtool: fix libopcodes linking with static libraries Sasha Levin
2026-01-21 19:08                       ` Rafael J. Wysocki
2026-01-21 19:25                         ` Peter Zijlstra
2026-01-21 19:28                       ` [tip: objtool/urgent] objtool: Fix " tip-bot2 for Sasha Levin

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=20260120102832.GJ1890602@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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

Powered by JetHome