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:Nathan Chancellor <nathan@kernel.org> Signed-off-by:
Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20220318230747.3900772-2-nathan@kernel.org Signed-off-by:
Wander Lairson Costa <wander@redhat.com>
Loading
Please register or sign in to comment