Re: [tip: objtool/core] objtool: Add CONFIG_OBJTOOL_WERROR
From: Steven Rostedt
Date: Thu Mar 20 2025 - 13:10:44 EST
On Mon, 17 Mar 2025 17:05:22 -0700
Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> Hm, I'm actually surprised randconfig doesn't set COMPILE_TEST.
>
> Anyway, the warnings are valid:
>
> vmlinux.o: error: objtool: do_syscall_64+0x40: call to ftrace_likely_update() leaves .noinstr.text section
> vmlinux.o: error: objtool: do_int80_emulation+0x30: call to ftrace_likely_update() leaves .noinstr.text section
> vmlinux.o: error: objtool: do_fast_syscall_32+0x7b: call to ftrace_likely_update() leaves .noinstr.text section
> ...
>
> Those are triggered by CONFIG_TRACE_BRANCH_PROFILING which adds a
> function call to ftrace_likely_update() for every likely() / unlikely().
> Which obliterates the noinstr rules.
>
> Steven, do you still want to keep that config option?
Yes, in fact I just ran it a couple of months ago:
https://rostedt.org/branches/current/
That's the output of both the likely and unlikely output as well as the
full branch tracer. I do look at this to fix places that are incorrect.
>
> If so, I suppose we could make OBJTOOL_WERROR depend on
> !TRACE_BRANCH_PROFILING.
>
That, or you can disable it for files with:
CFLAGS_<file>.o += -DDISABLE_BRANCH_PROFILING
In the Makefile.
-- Steve