Re: [PATCH 05/29] x86: Base IBT bits

From: Joao Moreira
Date: Fri Feb 18 2022 - 17:13:14 EST


+config CC_HAS_IBT
+ # GCC >= 9 and binutils >= 2.29
+ # Retpoline check to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93654
+ def_bool $(cc-option, -fcf-protection=branch
-mindirect-branch-register) && $(as-instr,endbr64)
+
Is -mindirect-branch-register breaks compiling with clang. Maybe we should we do instead?

+ def_bool ($(cc-option, -fcf-protection=branch -mindirect-branch-register) || $(cc-option, -mretpoline-external-thunk)) && $(as-instr,endbr64)