mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Chartre <alexandre.chartre@oracle.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: alexandre.chartre@oracle.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org, jpoimboe@kernel.org, peterz@infradead.org,
	david.laight.linux@gmail.com
Subject: Re: [PATCH v6 03/30] objtool: Disassemble code with libopcodes instead of running objdump
Date: Tue, 9 Dec 2025 08:51:09 +0100	[thread overview]
Message-ID: <28034b3c-b3f9-4ca6-a735-5f53da887391@oracle.com> (raw)
In-Reply-To: <26a97504-36ac-4005-a146-09895ae76645@roeck-us.net>


On 12/9/25 07:58, Guenter Roeck wrote:
> Hi,
> 
> On Fri, Nov 21, 2025 at 10:53:13AM +0100, Alexandre Chartre wrote:
>> objtool executes the objdump command to disassemble code. Use libopcodes
>> instead to have more control about the disassembly scope and output.
>> If libopcodes is not present then objtool is built without disassembly
>> support.
>>
>> Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
> 
> With this patch in mainline, I get the following build error when trying
> to build x86_64:defconfig (and other configurations).
> 
> Bisect log is attached. I see the problem with gcc 11.4.0, 13.3.0, and
> 14.3.0. I tried with both Ubuntu 22.04 and 24.04.
> 

This sounds like a configuration issue depending on the binutils version; in
particular the setting of DISASM_INIT_STYLED (although that's supposed to be
automatically configured by tools/objtool/Makefile).

Which binutils-devel version are you using?

Thanks,

alex.

> 
> Building x86_64:defconfig ... failed
> --------------
> Error log:
> In file included from disas.c:17:
> tools/include/tools/dis-asm-compat.h:19:39: error: ‘enum disassembler_style’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>     19 |                                  enum disassembler_style style,
>        |                                       ^~~~~~~~~~~~~~~~~~
> tools/include/tools/dis-asm-compat.h:19:58: error: parameter 2 (‘style’) has incomplete type
>     19 |                                  enum disassembler_style style,
>        |                                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
> tools/include/tools/dis-asm-compat.h:42:49: error: unknown type name ‘fprintf_styled_ftype’; did you mean ‘fprintf_ftype’?
>     42 |                                                 fprintf_styled_ftype styled_func)
>        |                                                 ^~~~~~~~~~~~~~~~~~~~
>        |                                                 fprintf_ftype
> disas.c:152:38: error: ‘enum disassembler_style’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
>    152 |                                 enum disassembler_style style,
>        |                                      ^~~~~~~~~~~~~~~~~~
> disas.c:152:57: error: parameter 2 (‘style’) has incomplete type
>    152 |                                 enum disassembler_style style,
>        |                                 ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
> disas.c: In function ‘disas_context_create’:
> disas.c:367:9: error: implicit declaration of function ‘init_disassemble_info_compat’; did you mean ‘init_disassemble_info’? [-Werror=implicit-function-declaration]
>    367 |         init_disassemble_info_compat(dinfo, dctx,
>        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>        |         init_disassemble_info
> In file included from tools/include/linux/kernel.h:5,
>                   from tools/include/linux/list.h:7,
>                   from tools/objtool/include/objtool/arch.h:10,
>                   from disas.c:9:
> disas.c: In function ‘disas_fprintf_styled’:
> disas.c:158:9: error: ‘va_start’ used in function with fixed arguments
>    158 |         va_start(arg, fmt);
>        |         ^~~~~~~~
> cc1: all warnings being treated as errors
> 
> ---
> Bisect:
> 
> # bad: [cb015814f8b6eebcbb8e46e111d108892c5e6821] Merge tag 'f2fs-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
> # good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
> git bisect start 'HEAD' 'v6.18'
> # bad: [6dfafbd0299a60bfb5d5e277fdf100037c7ded07] Merge tag 'drm-next-2025-12-03' of https://gitlab.freedesktop.org/drm/kernel
> git bisect bad 6dfafbd0299a60bfb5d5e277fdf100037c7ded07
> # bad: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
> git bisect bad 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
> # bad: [4a4e0199378f309fa7259132e1443efe56c1e276] Merge tag 'lkmm.2025.12.01a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
> git bisect bad 4a4e0199378f309fa7259132e1443efe56c1e276
> # bad: [a61288200e8b6f42bff116508dc72ebcc206f10a] Merge tag 'ras_core_for_v6.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect bad a61288200e8b6f42bff116508dc72ebcc206f10a
> # good: [1b5dd29869b1e63f7e5c37d7552e2dcf22de3c26] Merge tag 'vfs-6.19-rc1.fd_prepare.fs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
> git bisect good 1b5dd29869b1e63f7e5c37d7552e2dcf22de3c26
> # bad: [dcd8637edb873bd940e6aa82417dfb33ae980778] Merge tag 'x86-core-2025-12-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect bad dcd8637edb873bd940e6aa82417dfb33ae980778
> # bad: [7e017720aae87dc2ca2471ac295e34e2b240e5f5] objtool: Disassemble jump table alternatives
> git bisect bad 7e017720aae87dc2ca2471ac295e34e2b240e5f5
> # good: [164c9201e1dad8d5c0c38f583dba81e4b6da9cc7] objtool: Add base objtool support for livepatch modules
> git bisect good 164c9201e1dad8d5c0c38f583dba81e4b6da9cc7
> # good: [9205a322cf96f16a49e412dfa3f09431f3e02fc5] objtool: Return canonical symbol when aliases exist in symbol finding helpers
> git bisect good 9205a322cf96f16a49e412dfa3f09431f3e02fc5
> # bad: [0bb080ba6469a573bc85122153d931334d10a173] objtool: Disassemble instruction on warning or backtrace
> git bisect bad 0bb080ba6469a573bc85122153d931334d10a173
> # good: [93863f3f859a626347ce2ec18947b11357b4ca14] kbuild: Check for functions with ambiguous -ffunction-sections section names
> git bisect good 93863f3f859a626347ce2ec18947b11357b4ca14
> # bad: [59953303827eceb06d486ba66cc0d71f55ded8ec] objtool: Disassemble code with libopcodes instead of running objdump
> git bisect bad 59953303827eceb06d486ba66cc0d71f55ded8ec
> # good: [55d2a473f317ab028d78a5c5ca69473643657c3d] objtool: Move disassembly functions to a separated file
> git bisect good 55d2a473f317ab028d78a5c5ca69473643657c3d
> # good: [1013f2e37bec39b1df5679e1c1e2572ece87c088] objtool: Create disassembly context
> git bisect good 1013f2e37bec39b1df5679e1c1e2572ece87c088
> # first bad commit: [59953303827eceb06d486ba66cc0d71f55ded8ec] objtool: Disassemble code with libopcodes instead of running objdump


  reply	other threads:[~2025-12-09  7:51 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21  9:53 [PATCH v6 00/30] objtool: Function validation tracing Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 01/30] objtool: Move disassembly functions to a separated file Alexandre Chartre
2025-11-24  9:12   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 02/30] objtool: Create disassembly context Alexandre Chartre
2025-11-24  9:12   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 03/30] objtool: Disassemble code with libopcodes instead of running objdump Alexandre Chartre
2025-11-24  9:12   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-25 18:16   ` [PATCH v6 03/30] " Nathan Chancellor
2025-11-26  9:00     ` Alexandre Chartre
2025-11-26 10:07       ` David Laight
2025-11-26 10:29         ` Alexandre Chartre
2025-12-09  6:58   ` Guenter Roeck
2025-12-09  7:51     ` Alexandre Chartre [this message]
2025-12-09 15:11       ` Guenter Roeck
2025-12-09 22:25       ` Maciej W. Rozycki
2025-12-10  5:08         ` Guenter Roeck
2025-12-10  7:53           ` Alexandre Chartre
2025-12-10 15:26             ` Guenter Roeck
2025-12-10 16:36               ` Alexandre Chartre
2025-12-10 18:42                 ` Guenter Roeck
2025-12-10 21:54                   ` Guenter Roeck
2025-12-15 16:00                     ` Alexandre Chartre
2025-12-15 16:46                       ` Guenter Roeck
2025-12-10  7:06         ` Alexandre Chartre
2025-12-10  8:56           ` Peter Zijlstra
2025-12-10  8:53         ` Peter Zijlstra
2025-12-10 12:01           ` Maciej W. Rozycki
2025-11-21  9:53 ` [PATCH v6 04/30] tool build: Remove annoying newline in build output Alexandre Chartre
2025-11-24  9:12   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 05/30] objtool: Print symbol during disassembly Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 06/30] objtool: Store instruction disassembly result Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 07/30] objtool: Disassemble instruction on warning or backtrace Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 08/30] objtool: Extract code to validate instruction from the validate branch loop Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 09/30] objtool: Record symbol name max length Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 10/30] objtool: Add option to trace function validation Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 11/30] objtool: Trace instruction state changes during " Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-12-01 20:23   ` [PATCH v6 11/30] " Nathan Chancellor
2025-12-02  1:30     ` Josh Poimboeuf
2025-12-02  8:34       ` Alexandre Chartre
2025-12-02 16:13         ` Josh Poimboeuf
2025-12-02 18:09           ` David Laight
2025-11-21  9:53 ` [PATCH v6 12/30] objtool: Improve register reporting " Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 13/30] objtool: Identify the different types of alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 14/30] objtool: Add functions to better name alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 15/30] objtool: Improve tracing of alternative instructions Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 16/30] objtool: Do not validate IBT for .return_sites and .call_sites Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 17/30] objtool: Add the --disas=<function-pattern> action Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 18/30] objtool: Preserve alternatives order Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 19/30] objtool: Print headers for alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 20/30] objtool: Disassemble group alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 21/30] objtool: Print addresses with alternative instructions Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 22/30] objtool: Disassemble exception table alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 23/30] objtool: Disassemble jump " Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 24/30] objtool: Fix address references in alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 25/30] objtool: Provide access to feature and flags of group alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 26/30] objtool: Function to get the name of a CPU feature Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-24 10:44   ` tip-bot2 for Alexandre Chartre
2025-11-24 11:59     ` Peter Zijlstra
2025-11-24 12:26       ` Borislav Petkov
2025-11-24 12:40         ` Alexandre Chartre
2025-11-24 19:05           ` david laight
2025-11-24 16:43         ` Alexandre Chartre
2025-11-24 20:14           ` Borislav Petkov
2025-11-24 19:49   ` [tip: objtool/core] objtool: Add " tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 27/30] objtool: Improve naming of group alternatives Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-24 10:44   ` tip-bot2 for Alexandre Chartre
2025-11-24 19:49   ` tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 28/30] objtool: Compact output for alternatives with one instruction Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-24 10:43   ` tip-bot2 for Alexandre Chartre
2025-11-24 19:49   ` tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 29/30] objtool: Add wide output for disassembly Alexandre Chartre
2025-11-24  9:11   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-24 10:43   ` tip-bot2 for Alexandre Chartre
2025-11-24 19:49   ` tip-bot2 for Alexandre Chartre
2025-11-21  9:53 ` [PATCH v6 30/30] objtool: Trim trailing NOPs in alternative Alexandre Chartre
2025-11-24  9:10   ` [tip: objtool/core] " tip-bot2 for Alexandre Chartre
2025-11-24 10:43   ` tip-bot2 for Alexandre Chartre
2025-11-24 19:49   ` tip-bot2 for Alexandre Chartre
2025-11-21 10:36 ` [PATCH v6 00/30] objtool: Function validation tracing Peter Zijlstra
2025-11-21 13:16   ` Alexandre Chartre
2025-11-21 13:51     ` Alexandre Chartre
2025-11-21 14:30       ` Peter Zijlstra
2025-11-24 11:04 ` Borislav Petkov
2025-11-24 11:39   ` Alexandre Chartre
2025-11-24 12:39     ` Borislav Petkov
2025-11-24 12:27   ` David Laight

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=28034b3c-b3f9-4ca6-a735-5f53da887391@oracle.com \
    --to=alexandre.chartre@oracle.com \
    --cc=david.laight.linux@gmail.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®