Skip to content

Commit 3b446c7

Browse files
nickdesaulniersctmarinas
authored andcommitted
arm64: Kconfig: verify binutils support for ARM64_PTR_AUTH
Clang relies on GNU as from binutils to assemble the Linux kernel, currently. A recent patch to enable the armv8.3-a extension for pointer authentication checked for compiler support of the relevant flags. Everything works with binutils 2.34+, but for older versions we observe assembler errors: /tmp/vgettimeofday-36a54b.s: Assembler messages: /tmp/vgettimeofday-36a54b.s:40: Error: unknown pseudo-op: `.cfi_negate_ra_state' When compiling with Clang, require the assembler to support .cfi_negate_ra_state directives, in order to support CONFIG_ARM64_PTR_AUTH. Link: ClangBuiltLinux#938 Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Catalin Marinas <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]>
1 parent 6cb6982 commit 3b446c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/arm64/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,7 @@ config ARM64_PTR_AUTH
15001500
default y
15011501
depends on !KVM || ARM64_VHE
15021502
depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1503+
depends on CC_IS_GCC || (CC_IS_CLANG && AS_HAS_CFI_NEGATE_RA_STATE)
15031504
depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
15041505
help
15051506
Pointer authentication (part of the ARMv8.3 Extensions) provides
@@ -1544,6 +1545,9 @@ config CC_HAS_SIGN_RETURN_ADDRESS
15441545
config AS_HAS_PAC
15451546
def_bool $(as-option,-Wa$(comma)-march=armv8.3-a)
15461547

1548+
config AS_HAS_CFI_NEGATE_RA_STATE
1549+
def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
1550+
15471551
endmenu
15481552

15491553
menu "ARMv8.5 architectural features"

0 commit comments

Comments
 (0)