* [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
@ 2026-01-19 20:19 Rafael J. Wysocki
2026-01-20 10:28 ` Peter Zijlstra
0 siblings, 1 reply; 15+ messages in thread
From: Rafael J. Wysocki @ 2026-01-19 20:19 UTC (permalink / raw)
To: Sasha Levin
Cc: Peter Zijlstra, the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list
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.
BR, Rafael
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-19 20:19 [Regression in 6.19-rc6] Build breakage after commit 436326bc525d Rafael J. Wysocki
@ 2026-01-20 10:28 ` Peter Zijlstra
2026-01-20 17:40 ` Sasha Levin
0 siblings, 1 reply; 15+ messages in thread
From: Peter Zijlstra @ 2026-01-20 10:28 UTC (permalink / raw)
To: Rafael J. Wysocki, Josh Poimboeuf, Arnaldo Carvalho de Melo
Cc: Sasha Levin, the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 10:28 ` Peter Zijlstra
@ 2026-01-20 17:40 ` Sasha Levin
2026-01-20 18:29 ` Rafael J. Wysocki
0 siblings, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2026-01-20 17:40 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Rafael J. Wysocki, Josh Poimboeuf, Arnaldo Carvalho de Melo,
the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
>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.
Thanks for the report Rafael!
Could you confirm that you're linking against static libraries? I haven't
tested that scenario.
>Bah, I hate makefiles.
>
>Anyway, the below is that revert + adding an explicit libbfd-opcodes
>feature test.
If the issue is indeed static libs, then I don't think that the below would
work.
I think that we need to explicitly list out all the dependencies rather than
just -lopcodes.
With only -lopcodes:
$ echo '#include <dis-asm.h>
int main(void) { disassemble_init_for_target(NULL); return 0; }' | gcc -xc - -DPACKAGE='"test"' -lopcodes -o /tmp/test
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libopcodes.a(i386-dis.o): warning: relocation against `_sch_istable' in read-only section `.text'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libopcodes.a(i386-dis.o): in function `i386_dis_printf':
./builddir-single/opcodes/../../opcodes/i386-dis.c:9675:(.text+0x673): undefined reference to `_sch_istable'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libopcodes.a(i386-dis.o): in function `putop':
./builddir-single/opcodes/../../opcodes/i386-dis.c:10825:(.text+0x8f65): undefined reference to `_sch_istable'
/usr/bin/ld: ./builddir-single/opcodes/../../opcodes/i386-dis.c:11075:(.text+0x9eb1): undefined reference to `_sch_istable'
/usr/bin/ld: ./builddir-single/opcodes/../../opcodes/i386-dis.c:10919:(.text+0xa007): undefined reference to `_sch_istable'
/usr/bin/ld: ./builddir-single/opcodes/../../opcodes/i386-dis.c:11002:(.text+0xa190): undefined reference to `_sch_istable'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libopcodes.a(i386-dis.o):./builddir-single/opcodes/../../opcodes/i386-dis.c:11071: more undefined references to `_sch_istable' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libopcodes.a(disassemble.o): in function `opcodes_assert':
./builddir-single/opcodes/../../opcodes/disassemble.c:856:(.text+0x2ae): undefined reference to `_bfd_error_handler'
/usr/bin/ld: ./builddir-single/opcodes/../../opcodes/disassemble.c:857:(.text+0x2d0): undefined reference to `_bfd_error_handler'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
With the rest of the dependencies:
$ echo '#include <dis-asm.h>
int main(void) { disassemble_init_for_target(NULL); return 0; }' | gcc -xc - -DPACKAGE='"test"' -lopcodes -lbfd -liberty -lz -o /tmp/test
$ echo $?
0
But I'm not sure how we determine what the dependencies are exactly without
trying all the various combinations of them...
The below patch also brings back the cross compilation issue that originally
prompted my patch (see
https://qa-reports.linaro.org/lkft/sashal-linus-next/build/v6.18-rc7-14082-gef67311bf79e/testrun/30638724/suite/build/test/gcc-14-ppc6xx_defconfig/log)
>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
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 17:40 ` Sasha Levin
@ 2026-01-20 18:29 ` Rafael J. Wysocki
2026-01-20 19:58 ` Sasha Levin
0 siblings, 1 reply; 15+ messages in thread
From: Rafael J. Wysocki @ 2026-01-20 18:29 UTC (permalink / raw)
To: Sasha Levin
Cc: Peter Zijlstra, Rafael J. Wysocki, Josh Poimboeuf,
Arnaldo Carvalho de Melo, the arch/x86 maintainers,
Linus Torvalds, Linux Kernel Mailing List,
Linux regressions mailing list, irogers
On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
>
> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
> >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.
>
> Thanks for the report Rafael!
>
> Could you confirm that you're linking against static libraries? I haven't
> tested that scenario.
How do I check that?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 18:29 ` Rafael J. Wysocki
@ 2026-01-20 19:58 ` Sasha Levin
2026-01-20 20:04 ` Rafael J. Wysocki
0 siblings, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2026-01-20 19:58 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Peter Zijlstra, Josh Poimboeuf, Arnaldo Carvalho de Melo,
the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
>On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
>>
>> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
>> >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.
>>
>> Thanks for the report Rafael!
>>
>> Could you confirm that you're linking against static libraries? I haven't
>> tested that scenario.
>
>How do I check that?
What do you get running the below?
ls /usr/lib/*/libopcodes*
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 19:58 ` Sasha Levin
@ 2026-01-20 20:04 ` Rafael J. Wysocki
2026-01-20 20:22 ` Sasha Levin
0 siblings, 1 reply; 15+ messages in thread
From: Rafael J. Wysocki @ 2026-01-20 20:04 UTC (permalink / raw)
To: Sasha Levin
Cc: Rafael J. Wysocki, Peter Zijlstra, Josh Poimboeuf,
Arnaldo Carvalho de Melo, the arch/x86 maintainers,
Linus Torvalds, Linux Kernel Mailing List,
Linux regressions mailing list, irogers
On Tue, Jan 20, 2026 at 8:58 PM Sasha Levin <sashal@kernel.org> wrote:
>
> On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
> >On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
> >>
> >> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
> >> >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.
> >>
> >> Thanks for the report Rafael!
> >>
> >> Could you confirm that you're linking against static libraries? I haven't
> >> tested that scenario.
> >
> >How do I check that?
>
> What do you get running the below?
>
> ls /usr/lib/*/libopcodes*
"No such file or directory"
However,
> ls /usr/lib64/libopcodes*
/usr/lib64/libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.a
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 20:04 ` Rafael J. Wysocki
@ 2026-01-20 20:22 ` Sasha Levin
2026-01-20 21:33 ` Rafael J. Wysocki
0 siblings, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2026-01-20 20:22 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Peter Zijlstra, Josh Poimboeuf, Arnaldo Carvalho de Melo,
the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
On Tue, Jan 20, 2026 at 09:04:25PM +0100, Rafael J. Wysocki wrote:
>On Tue, Jan 20, 2026 at 8:58 PM Sasha Levin <sashal@kernel.org> wrote:
>>
>> On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
>> >On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
>> >>
>> >> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
>> >> >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.
>> >>
>> >> Thanks for the report Rafael!
>> >>
>> >> Could you confirm that you're linking against static libraries? I haven't
>> >> tested that scenario.
>> >
>> >How do I check that?
>>
>> What do you get running the below?
>>
>> ls /usr/lib/*/libopcodes*
>
>"No such file or directory"
>
>However,
>
>> ls /usr/lib64/libopcodes*
>/usr/lib64/libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.a
The linker looks for libopcodes.so (not the versioned .so). Without that
symlink, it falls back to libopcodes.a. So yes, looks like you're using static
linking.
To confirm, can you try to:
sudo ln -s libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.so
Any then running the build again?
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 20:22 ` Sasha Levin
@ 2026-01-20 21:33 ` Rafael J. Wysocki
2026-01-21 1:18 ` Sasha Levin
0 siblings, 1 reply; 15+ messages in thread
From: Rafael J. Wysocki @ 2026-01-20 21:33 UTC (permalink / raw)
To: Sasha Levin
Cc: Rafael J. Wysocki, Peter Zijlstra, Josh Poimboeuf,
Arnaldo Carvalho de Melo, the arch/x86 maintainers,
Linus Torvalds, Linux Kernel Mailing List,
Linux regressions mailing list, irogers
On Tue, Jan 20, 2026 at 9:22 PM Sasha Levin <sashal@kernel.org> wrote:
>
> On Tue, Jan 20, 2026 at 09:04:25PM +0100, Rafael J. Wysocki wrote:
> >On Tue, Jan 20, 2026 at 8:58 PM Sasha Levin <sashal@kernel.org> wrote:
> >>
> >> On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
> >> >On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
> >> >>
> >> >> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
> >> >> >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.
> >> >>
> >> >> Thanks for the report Rafael!
> >> >>
> >> >> Could you confirm that you're linking against static libraries? I haven't
> >> >> tested that scenario.
> >> >
> >> >How do I check that?
> >>
> >> What do you get running the below?
> >>
> >> ls /usr/lib/*/libopcodes*
> >
> >"No such file or directory"
> >
> >However,
> >
> >> ls /usr/lib64/libopcodes*
> >/usr/lib64/libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.a
>
> The linker looks for libopcodes.so (not the versioned .so). Without that
> symlink, it falls back to libopcodes.a. So yes, looks like you're using static
> linking.
>
> To confirm, can you try to:
>
> sudo ln -s libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.so
>
> Any then running the build again?
Yes, this makes the build work (without reverting the commit in question).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-20 21:33 ` Rafael J. Wysocki
@ 2026-01-21 1:18 ` Sasha Levin
2026-01-21 5:29 ` Josh Poimboeuf
0 siblings, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2026-01-21 1:18 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Peter Zijlstra, Josh Poimboeuf, Arnaldo Carvalho de Melo,
the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
On Tue, Jan 20, 2026 at 10:33:12PM +0100, Rafael J. Wysocki wrote:
>On Tue, Jan 20, 2026 at 9:22 PM Sasha Levin <sashal@kernel.org> wrote:
>>
>> On Tue, Jan 20, 2026 at 09:04:25PM +0100, Rafael J. Wysocki wrote:
>> >On Tue, Jan 20, 2026 at 8:58 PM Sasha Levin <sashal@kernel.org> wrote:
>> >>
>> >> On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
>> >> >On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
>> >> >>
>> >> >> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
>> >> >> >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.
>> >> >>
>> >> >> Thanks for the report Rafael!
>> >> >>
>> >> >> Could you confirm that you're linking against static libraries? I haven't
>> >> >> tested that scenario.
>> >> >
>> >> >How do I check that?
>> >>
>> >> What do you get running the below?
>> >>
>> >> ls /usr/lib/*/libopcodes*
>> >
>> >"No such file or directory"
>> >
>> >However,
>> >
>> >> ls /usr/lib64/libopcodes*
>> >/usr/lib64/libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.a
>>
>> The linker looks for libopcodes.so (not the versioned .so). Without that
>> symlink, it falls back to libopcodes.a. So yes, looks like you're using static
>> linking.
>>
>> To confirm, can you try to:
>>
>> sudo ln -s libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.so
>>
>> Any then running the build again?
>
>Yes, this makes the build work (without reverting the commit in question).
Great! So something like the patch below should fix the static scenario. I've
tested it locally on Debian but it'll be great to give it a go on a different
distro.
It's also a bit ugly, but I'm not really sure what we can do about it. No
dependency info in static libs :/
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 9b4503113ce5f..a40f302329291 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -77,8 +77,21 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
# 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)
+# 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.
+#
+LIBOPCODES_LIBS := $(shell \
+ for libs in "-lopcodes" \
+ "-lopcodes -lbfd" \
+ "-lopcodes -lbfd -liberty" \
+ "-lopcodes -lbfd -liberty -lz"; do \
+ echo 'extern void disassemble_init_for_target(void *);' \
+ 'int main(void) { disassemble_init_for_target(0); return 0; }' | \
+ $(HOSTCC) -xc - -o /dev/null $$libs 2>/dev/null && \
+ echo "$$libs" && break; \
+ done)
# Styled disassembler support requires binutils >= 2.39
HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
@@ -86,10 +99,10 @@ HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
BUILD_DISAS := n
-ifeq ($(HAVE_LIBOPCODES),y)
+ifneq ($(LIBOPCODES_LIBS),)
BUILD_DISAS := y
OBJTOOL_CFLAGS += -DDISAS -DPACKAGE='"objtool"'
- OBJTOOL_LDFLAGS += -lopcodes
+ OBJTOOL_LDFLAGS += $(LIBOPCODES_LIBS)
ifeq ($(HAVE_DISASM_STYLED),y)
OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
endif
--
Thanks,
Sasha
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
2026-01-21 1:18 ` Sasha Levin
@ 2026-01-21 5:29 ` Josh Poimboeuf
2026-01-21 12:06 ` Sasha Levin
0 siblings, 1 reply; 15+ messages in thread
From: Josh Poimboeuf @ 2026-01-21 5:29 UTC (permalink / raw)
To: Sasha Levin
Cc: Rafael J. Wysocki, Peter Zijlstra, Arnaldo Carvalho de Melo,
the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
On Tue, Jan 20, 2026 at 08:18:35PM -0500, Sasha Levin wrote:
> On Tue, Jan 20, 2026 at 10:33:12PM +0100, Rafael J. Wysocki wrote:
> > On Tue, Jan 20, 2026 at 9:22 PM Sasha Levin <sashal@kernel.org> wrote:
> > >
> > > On Tue, Jan 20, 2026 at 09:04:25PM +0100, Rafael J. Wysocki wrote:
> > > >On Tue, Jan 20, 2026 at 8:58 PM Sasha Levin <sashal@kernel.org> wrote:
> > > >>
> > > >> On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
> > > >> >On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
> > > >> >>
> > > >> >> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
> > > >> >> >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.
> > > >> >>
> > > >> >> Thanks for the report Rafael!
> > > >> >>
> > > >> >> Could you confirm that you're linking against static libraries? I haven't
> > > >> >> tested that scenario.
> > > >> >
> > > >> >How do I check that?
> > > >>
> > > >> What do you get running the below?
> > > >>
> > > >> ls /usr/lib/*/libopcodes*
> > > >
> > > >"No such file or directory"
> > > >
> > > >However,
> > > >
> > > >> ls /usr/lib64/libopcodes*
> > > >/usr/lib64/libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.a
> > >
> > > The linker looks for libopcodes.so (not the versioned .so). Without that
> > > symlink, it falls back to libopcodes.a. So yes, looks like you're using static
> > > linking.
> > >
> > > To confirm, can you try to:
> > >
> > > sudo ln -s libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.so
> > >
> > > Any then running the build again?
> >
> > Yes, this makes the build work (without reverting the commit in question).
>
> Great! So something like the patch below should fix the static scenario. I've
> tested it locally on Debian but it'll be great to give it a go on a different
> distro.
>
> It's also a bit ugly, but I'm not really sure what we can do about it. No
> dependency info in static libs :/
>
>
> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index 9b4503113ce5f..a40f302329291 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -77,8 +77,21 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
> # 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)
> +# 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.
> +#
> +LIBOPCODES_LIBS := $(shell \
> + for libs in "-lopcodes" \
> + "-lopcodes -lbfd" \
> + "-lopcodes -lbfd -liberty" \
> + "-lopcodes -lbfd -liberty -lz"; do \
Instead of hard-coding all the libraries, I think we can just use
pkg-config to tell us the needed dependencies.
See for example what we're already doing elsewhere in that Makefile:
LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null)
LIBELF_LIBS := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf)
--
Josh
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Regression in 6.19-rc6] Build breakage after commit 436326bc525d
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
0 siblings, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2026-01-21 12:06 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: Rafael J. Wysocki, Peter Zijlstra, Arnaldo Carvalho de Melo,
the arch/x86 maintainers, Linus Torvalds,
Linux Kernel Mailing List, Linux regressions mailing list,
irogers
On Tue, Jan 20, 2026 at 09:29:21PM -0800, Josh Poimboeuf wrote:
>On Tue, Jan 20, 2026 at 08:18:35PM -0500, Sasha Levin wrote:
>> On Tue, Jan 20, 2026 at 10:33:12PM +0100, Rafael J. Wysocki wrote:
>> > On Tue, Jan 20, 2026 at 9:22 PM Sasha Levin <sashal@kernel.org> wrote:
>> > >
>> > > On Tue, Jan 20, 2026 at 09:04:25PM +0100, Rafael J. Wysocki wrote:
>> > > >On Tue, Jan 20, 2026 at 8:58 PM Sasha Levin <sashal@kernel.org> wrote:
>> > > >>
>> > > >> On Tue, Jan 20, 2026 at 07:29:58PM +0100, Rafael J. Wysocki wrote:
>> > > >> >On Tue, Jan 20, 2026 at 6:40 PM Sasha Levin <sashal@kernel.org> wrote:
>> > > >> >>
>> > > >> >> On Tue, Jan 20, 2026 at 11:28:32AM +0100, Peter Zijlstra wrote:
>> > > >> >> >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.
>> > > >> >>
>> > > >> >> Thanks for the report Rafael!
>> > > >> >>
>> > > >> >> Could you confirm that you're linking against static libraries? I haven't
>> > > >> >> tested that scenario.
>> > > >> >
>> > > >> >How do I check that?
>> > > >>
>> > > >> What do you get running the below?
>> > > >>
>> > > >> ls /usr/lib/*/libopcodes*
>> > > >
>> > > >"No such file or directory"
>> > > >
>> > > >However,
>> > > >
>> > > >> ls /usr/lib64/libopcodes*
>> > > >/usr/lib64/libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.a
>> > >
>> > > The linker looks for libopcodes.so (not the versioned .so). Without that
>> > > symlink, it falls back to libopcodes.a. So yes, looks like you're using static
>> > > linking.
>> > >
>> > > To confirm, can you try to:
>> > >
>> > > sudo ln -s libopcodes-2.45.0.20251103-150100757.so /usr/lib64/libopcodes.so
>> > >
>> > > Any then running the build again?
>> >
>> > Yes, this makes the build work (without reverting the commit in question).
>>
>> Great! So something like the patch below should fix the static scenario. I've
>> tested it locally on Debian but it'll be great to give it a go on a different
>> distro.
>>
>> It's also a bit ugly, but I'm not really sure what we can do about it. No
>> dependency info in static libs :/
>>
>>
>> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
>> index 9b4503113ce5f..a40f302329291 100644
>> --- a/tools/objtool/Makefile
>> +++ b/tools/objtool/Makefile
>> @@ -77,8 +77,21 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
>> # 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)
>> +# 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.
>> +#
>> +LIBOPCODES_LIBS := $(shell \
>> + for libs in "-lopcodes" \
>> + "-lopcodes -lbfd" \
>> + "-lopcodes -lbfd -liberty" \
>> + "-lopcodes -lbfd -liberty -lz"; do \
>
>Instead of hard-coding all the libraries, I think we can just use
>pkg-config to tell us the needed dependencies.
>
>See for example what we're already doing elsewhere in that Makefile:
>
>LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null)
>LIBELF_LIBS := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf)
It works for elfutils because they adopted pkg-config, but binutils doesn't
work with pkg-config:
$ pkg-config libelf --libs
-lelf
$ pkg-config libopcodes --libs
Package libopcodes was not found in the pkg-config search path.
Perhaps you should add the directory containing `libopcodes.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libopcodes', required by 'virtual:world', not found
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] objtool: fix libopcodes linking with static libraries
2026-01-21 12:06 ` Sasha Levin
@ 2026-01-21 16:25 ` Sasha Levin
2026-01-21 19:08 ` Rafael J. Wysocki
2026-01-21 19:28 ` [tip: objtool/urgent] objtool: Fix " tip-bot2 for Sasha Levin
0 siblings, 2 replies; 15+ messages in thread
From: Sasha Levin @ 2026-01-21 16:25 UTC (permalink / raw)
To: sashal
Cc: acme, irogers, jpoimboe, linux-kernel, peterz, rafael,
regressions, torvalds, x86
Commit 436326bc525d ("objtool: fix build failure due to missing libopcodes
check") tests for libopcodes using an empty main(), which passes even when
static libraries lack their dependencies. This causes undefined reference
errors (xmalloc, bfd_get_bits, etc.) when linking against static libopcodes
without its required libbfd and libiberty.
Fix by testing with an actual libopcodes symbol and trying increasingly
complete library combinations until one succeeds.
Fixes: 436326bc525d ("objtool: fix build failure due to missing libopcodes check")
Reported-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Rafael, I'd appreciate if you could test this patch without the .so symlink
workaround. Thanks :)
tools/objtool/Makefile | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 9b4503113ce5f..a40f302329291 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -77,8 +77,21 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
# 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)
+# 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.
+#
+LIBOPCODES_LIBS := $(shell \
+ for libs in "-lopcodes" \
+ "-lopcodes -lbfd" \
+ "-lopcodes -lbfd -liberty" \
+ "-lopcodes -lbfd -liberty -lz"; do \
+ echo 'extern void disassemble_init_for_target(void *);' \
+ 'int main(void) { disassemble_init_for_target(0); return 0; }' | \
+ $(HOSTCC) -xc - -o /dev/null $$libs 2>/dev/null && \
+ echo "$$libs" && break; \
+ done)
# Styled disassembler support requires binutils >= 2.39
HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
@@ -86,10 +99,10 @@ HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
BUILD_DISAS := n
-ifeq ($(HAVE_LIBOPCODES),y)
+ifneq ($(LIBOPCODES_LIBS),)
BUILD_DISAS := y
OBJTOOL_CFLAGS += -DDISAS -DPACKAGE='"objtool"'
- OBJTOOL_LDFLAGS += -lopcodes
+ OBJTOOL_LDFLAGS += $(LIBOPCODES_LIBS)
ifeq ($(HAVE_DISASM_STYLED),y)
OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
endif
--
2.51.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] objtool: fix libopcodes linking with static libraries
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
1 sibling, 1 reply; 15+ messages in thread
From: Rafael J. Wysocki @ 2026-01-21 19:08 UTC (permalink / raw)
To: Sasha Levin
Cc: acme, irogers, jpoimboe, linux-kernel, peterz, rafael,
regressions, torvalds, x86
On Wed, Jan 21, 2026 at 5:25 PM Sasha Levin <sashal@kernel.org> wrote:
>
> Commit 436326bc525d ("objtool: fix build failure due to missing libopcodes
> check") tests for libopcodes using an empty main(), which passes even when
> static libraries lack their dependencies. This causes undefined reference
> errors (xmalloc, bfd_get_bits, etc.) when linking against static libopcodes
> without its required libbfd and libiberty.
>
> Fix by testing with an actual libopcodes symbol and trying increasingly
> complete library combinations until one succeeds.
>
> Fixes: 436326bc525d ("objtool: fix build failure due to missing libopcodes check")
> Reported-by: Rafael J. Wysocki <rafael@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>
> Rafael, I'd appreciate if you could test this patch without the .so symlink
> workaround. Thanks :)
Works here, so
Tested-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
> tools/objtool/Makefile | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index 9b4503113ce5f..a40f302329291 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -77,8 +77,21 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
> # 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)
> +# 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.
> +#
> +LIBOPCODES_LIBS := $(shell \
> + for libs in "-lopcodes" \
> + "-lopcodes -lbfd" \
> + "-lopcodes -lbfd -liberty" \
> + "-lopcodes -lbfd -liberty -lz"; do \
> + echo 'extern void disassemble_init_for_target(void *);' \
> + 'int main(void) { disassemble_init_for_target(0); return 0; }' | \
> + $(HOSTCC) -xc - -o /dev/null $$libs 2>/dev/null && \
> + echo "$$libs" && break; \
> + done)
>
> # Styled disassembler support requires binutils >= 2.39
> HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
> @@ -86,10 +99,10 @@ HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
>
> BUILD_DISAS := n
>
> -ifeq ($(HAVE_LIBOPCODES),y)
> +ifneq ($(LIBOPCODES_LIBS),)
> BUILD_DISAS := y
> OBJTOOL_CFLAGS += -DDISAS -DPACKAGE='"objtool"'
> - OBJTOOL_LDFLAGS += -lopcodes
> + OBJTOOL_LDFLAGS += $(LIBOPCODES_LIBS)
> ifeq ($(HAVE_DISASM_STYLED),y)
> OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
> endif
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] objtool: fix libopcodes linking with static libraries
2026-01-21 19:08 ` Rafael J. Wysocki
@ 2026-01-21 19:25 ` Peter Zijlstra
0 siblings, 0 replies; 15+ messages in thread
From: Peter Zijlstra @ 2026-01-21 19:25 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Sasha Levin, acme, irogers, jpoimboe, linux-kernel, regressions,
torvalds, x86
On Wed, Jan 21, 2026 at 08:08:51PM +0100, Rafael J. Wysocki wrote:
> On Wed, Jan 21, 2026 at 5:25 PM Sasha Levin <sashal@kernel.org> wrote:
> >
> > Commit 436326bc525d ("objtool: fix build failure due to missing libopcodes
> > check") tests for libopcodes using an empty main(), which passes even when
> > static libraries lack their dependencies. This causes undefined reference
> > errors (xmalloc, bfd_get_bits, etc.) when linking against static libopcodes
> > without its required libbfd and libiberty.
> >
> > Fix by testing with an actual libopcodes symbol and trying increasingly
> > complete library combinations until one succeeds.
> >
> > Fixes: 436326bc525d ("objtool: fix build failure due to missing libopcodes check")
> > Reported-by: Rafael J. Wysocki <rafael@kernel.org>
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > ---
> >
> > Rafael, I'd appreciate if you could test this patch without the .so symlink
> > workaround. Thanks :)
>
> Works here, so
>
> Tested-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Excellent, thanks all!
^ permalink raw reply [flat|nested] 15+ messages in thread
* [tip: objtool/urgent] objtool: Fix libopcodes linking with static libraries
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:28 ` tip-bot2 for Sasha Levin
1 sibling, 0 replies; 15+ messages in thread
From: tip-bot2 for Sasha Levin @ 2026-01-21 19:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: Rafael J. Wysocki, Sasha Levin, Peter Zijlstra (Intel), x86,
linux-kernel
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: 3f2de814c0597c97d5abe09a1635d8c4e2fddaf2
Gitweb: https://git.kernel.org/tip/3f2de814c0597c97d5abe09a1635d8c4e2fddaf2
Author: Sasha Levin <sashal@kernel.org>
AuthorDate: Wed, 21 Jan 2026 11:25:32 -05:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 21 Jan 2026 20:25:14 +01:00
objtool: Fix libopcodes linking with static libraries
Commit 436326bc525d ("objtool: fix build failure due to missing libopcodes
check") tests for libopcodes using an empty main(), which passes even when
static libraries lack their dependencies. This causes undefined reference
errors (xmalloc, bfd_get_bits, etc.) when linking against static libopcodes
without its required libbfd and libiberty.
Fix by testing with an actual libopcodes symbol and trying increasingly
complete library combinations until one succeeds.
Fixes: 436326bc525d ("objtool: fix build failure due to missing libopcodes check")
Reported-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Link: https://patch.msgid.link/20260121162532.1596238-1-sashal@kernel.org
---
tools/objtool/Makefile | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 9b45031..a40f302 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -77,8 +77,21 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
# 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)
+# 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.
+#
+LIBOPCODES_LIBS := $(shell \
+ for libs in "-lopcodes" \
+ "-lopcodes -lbfd" \
+ "-lopcodes -lbfd -liberty" \
+ "-lopcodes -lbfd -liberty -lz"; do \
+ echo 'extern void disassemble_init_for_target(void *);' \
+ 'int main(void) { disassemble_init_for_target(0); return 0; }' | \
+ $(HOSTCC) -xc - -o /dev/null $$libs 2>/dev/null && \
+ echo "$$libs" && break; \
+ done)
# Styled disassembler support requires binutils >= 2.39
HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
@@ -86,10 +99,10 @@ HAVE_DISASM_STYLED := $(shell echo '$(pound)include <dis-asm.h>' | \
BUILD_DISAS := n
-ifeq ($(HAVE_LIBOPCODES),y)
+ifneq ($(LIBOPCODES_LIBS),)
BUILD_DISAS := y
OBJTOOL_CFLAGS += -DDISAS -DPACKAGE='"objtool"'
- OBJTOOL_LDFLAGS += -lopcodes
+ OBJTOOL_LDFLAGS += $(LIBOPCODES_LIBS)
ifeq ($(HAVE_DISASM_STYLED),y)
OBJTOOL_CFLAGS += -DDISASM_INIT_STYLED
endif
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-01-21 19:28 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19 20:19 [Regression in 6.19-rc6] Build breakage after commit 436326bc525d Rafael J. Wysocki
2026-01-20 10:28 ` Peter Zijlstra
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox