Skip to content
Snippets Groups Projects
Unverified Commit b4e21c09 authored by Wander Lairson Costa's avatar Wander Lairson Costa
Browse files

x86/Kconfig: Only enable CONFIG_CC_HAS_IBT for clang >= 14.0.0

Bugzilla: https://bugzilla.redhat.com/1955275



commit 262448f3
Author: Nathan Chancellor <nathan@kernel.org>
Date:   Fri Mar 18 16:07:46 2022 -0700

    x86/Kconfig: Only enable CONFIG_CC_HAS_IBT for clang >= 14.0.0

    Commit 156ff4a5 ("x86/ibt: Base IBT bits") added a check for a crash
    with 'clang -fcf-protection=branch -mfentry -pg', which intended to
    exclude Clang versions older than 14.0.0 from selecting
    CONFIG_X86_KERNEL_IBT.

    clang-11 does not have the issue that the check is testing for, so
    CONFIG_X86_KERNEL_IBT is selectable. Unfortunately, there is a different
    crash in clang-11 that was fixed in clang-12. To make matters worse,
    that crash does not appear to be entirely deterministic, as the same
    input to the compiler will sometimes crash and other times not, which
    makes dynamically checking for the crash like the '-pg' one unreliable.

    To make everything work properly for all common versions of clang, use a
    hard version check of 14.0.0, as that will be the first release upstream
    that has both bugs properly fixed.

Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20220318230747.3900772-2-nathan@kernel.org



Signed-off-by: default avatarWander Lairson Costa <wander@redhat.com>
parent 491382f1
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment