[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAR25_zLXmiyEs4N44Pi0qsyPGiuqSUUw-BbtQXyNmh-Og@mail.gmail.com>
Date: Tue, 10 Jul 2018 08:17:06 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: X86 ML <x86@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Kees Cook <keescook@...omium.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>
Subject: Re: [PATCH] objtool: move libelf detection to Kconfig from Makefile
2018-07-10 4:21 GMT+09:00 Josh Poimboeuf <jpoimboe@...hat.com>:
> On Sun, Jul 08, 2018 at 06:59:42PM +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@...ionext.com>
>
> Thanks for cleaning this up!
>
>> I am sure about this patch only from the build system point of view.
>>
>> Please review this from x86 and objtool point of view.
>>
>> In my understanding:
>>
>> - UNWINDER_ORC _requires_ objtool,
>> so I added 'depends on STACK_VALIDATION'.
>> ('select' would end up with unmet depenency)
>
> Correct.
>
>> - RETPOLINE _wants_ objtool, so I added 'imply'
>
> Yeah, I think this is fine.
>
> Acked-by: Josh Poimboeuf <jpoimboe@...hat.com>
Thanks for your review!
I have one question.
The package information is contained in the warning/error message.
Is it better to keep this?
If so, I will send v2
to move the information to the help, like this:
config STACK_VALIDATION
bool "Compile-time stack metadata validation"
depends on HAVE_STACK_VALIDATION
depends on $(success,echo "int main() {}" | $(HOSTCC) -xc -o
/dev/null -lelf -)
help
Add compile-time checks to validate stack metadata, including frame
pointers (if CONFIG_FRAME_POINTER is enabled). This helps ensure
that runtime stack traces are more reliable.
This is also a prerequisite for generation of ORC unwind data, which
is needed for CONFIG_UNWINDER_ORC.
+ To enable this, the host compiler needs to be able to link libelf.
+ If it is missing, please install libelf-dev, libelf-devel or
+ elfutils-libelf-devel.
For more information, see
tools/objtool/Documentation/stack-validation.txt.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists