Re: [PATCH v2] objtool: move libelf detection to Kconfig from Makefile

From: Josh Poimboeuf
Date: Mon Jul 09 2018 - 22:29:21 EST


On Tue, Jul 10, 2018 at 10:35:16AM +0900, Masahiro Yamada wrote:
> Currently, users are allowed to enable STACK_VALIDATION regardless
> of the compiler capability. The top-level Makefile warns or breaks
> the build if it turns out that the host compiler cannot link libelf.
>
> Move the libelf test to Kconfig so that users can enable the feature
> only when the host compiler can build the objtool. The ugly check
> in the Makefile will go away.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
> Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Actually, looking at this again, I want to rescind my ack.

This patches changes the behavior in a subtle (but important) way.

Before, if I did "make defconfig", it would *always* choose the ORC
unwinder. Then, if I didn't have libelf-devel, the build would fail and
it would tell me what I need to install.

But now with this patch, if I do "make defconfig", the generated config
actually changes based on what I happen to have installed on my build
system. If I don't have libelf-devel, then it silently chooses the
non-default unwinder (frame pointer).

This is a subtle difference, but IMO it's dangerous, because it will
silently enable the frame pointer unwinder for the majority of new
systems, even though it's not the default.

I strongly prefer the original behavior, because we really want to
encourage people to use the ORC unwinder, even if that means they have
to install a package to build it.

Also -- in general -- I suspect that silently changing the defaults like
this will create a lot of bad surprises. The output of "make defconfig"
should be predictable and not dependent on what RPMs I happen to have
installed.

--
Josh