Re: [RFC 00/13] objtool: Function validation tracing

From: Alexandre Chartre
Date: Wed Jun 11 2025 - 02:00:59 EST



On 6/10/25 23:05, Josh Poimboeuf wrote:
On Tue, Jun 10, 2025 at 03:00:50PM +0200, Alexandre Chartre wrote:
Here is the patch to handle both old and new binutils versions:

8<------------------------------------------------------------------->8
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 00350fc7c662..91a2858fea14 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -7,6 +7,11 @@ srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
+FEATURE_USER = .objtool
+FEATURE_TESTS = disassembler-init-styled
+FEATURE_DISPLAY = disassembler-init-styled
+include $(srctree)/tools/build/Makefile.feature

Thanks, that worked.

That Makefile.feature thing is nice (except it prints an annoying
newline on every build after the first one).

Can we also use that to determine if binutils-devel (or binutils-dev or
whatever) is installed, and then make the build of disas.c optional?

This would probably require a new feature test, I will look at it.

Then if somebody tries to use '--trace', it could tell them to install
the binutils development package and rebuild objtool. That way we don't
disrupt everybody's kernel build for a feature they probably won't use.

That would also mean disas_warned_funcs() would be disabled on missing
binutils-devel. But I think that's probably fine. In fact that will
now have less reason for existing now that we have this tracing. Maybe
we won't need it at all.


We can also fall back to using objdump if binutils-devel is not there.

And thanks for all the other comments, I will address them and resubmit. I am
also adding the "disas" option.

alex.