Re: [PATCH 2/5] X86-64 should not uniquely require a third ELF package to build.

From: Thomas Gleixner
Date: Tue Feb 21 2023 - 18:12:33 EST


Rob!

On Tue, Feb 21 2023 at 14:56, Rob Landley wrote:

The subject line is not compliant to documentation. Please read and
follow Documentation/process/* especially submitting-patches.rst and
maintainer-tip.rst

> x86-64 is the only architecture that can't compile without an extra
> ELF library installed on the host. (The kernel already has multiple ELF
> parse implementations built-in, so requiring another one is questionable
> at best.)

How are ELF parsers in the kernel itself related to a build requirement
for a tool, which is part of the kernel build process?

Next time you ask for removal of perl, python or whatever the kernel
requires to build.

> You can switch it back on in menuconfig if you want to, this
> just stops it being mandatory.

How do you switch on CONFIG_HAVE_OBJTOOL in menuconfig?

config HAVE_OBJTOOL
bool

There is no knob.

> See https://lkml.iu.edu/hypermail/linux/kernel/2110.3/00402.html
> and https://lkml.iu.edu/hypermail/linux/kernel/2110.3/00278.html

Please use https://lore.kernel.org/lkml/ links.

> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 3604074a878b..b63510d79baf 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -243,7 +243,6 @@ config X86
> select HAVE_NOINSTR_HACK if HAVE_OBJTOOL
> select HAVE_NMI
> select HAVE_NOINSTR_VALIDATION if HAVE_OBJTOOL
> - select HAVE_OBJTOOL if X86_64

This prevents runtime features, optimizations, mitigations and build
time validations rom being selected as you can see from your patch
context.

Just to be clear: objtool is mandatory for x86_64 builds.

git grep 'select HAVE_OBJTOOL' will tell you that your claim about
x86_64 being the only architecture is slightly wrong.

Thanks,

tglx