Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 4735a03

Browse files
broonieKendrenogen
authored andcommitted
arm64: Depend on newer binutils when building PAC
Versions of binutils prior to 2.33.1 don't understand the ELF notes that are added by modern compilers to indicate the PAC and BTI options used to build the code. This causes them to emit large numbers of warnings in the form: aarch64-linux-gnu-nm: warning: .tmp_vmlinux.kallsyms2: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 during the kernel build which is currently causing quite a bit of disruption for automated build testing using clang. In commit 9778538e45dd794 (arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch) we added a dependency on binutils to avoid this issue when building with versions of GCC that emit the notes but did not do so for clang as it was believed that the existing check for .cfi_negate_ra_state was already requiring a new enough binutils. This does not appear to be the case for some versions of binutils (eg, the binutils in Debian 10) so instead refactor so we require a new enough GNU binutils in all cases other than when we are using an old GCC version that does not emit notes. Other, more exotic, combinations of tools are possible such as using clang, lld and gas together are possible and may have further problems but rather than adding further version checks it looks like the most robust thing will be to just test that we can build cleanly with the configured tools but that will require more review and discussion so do this for now to address the immediate problem disrupting build testing. Reported-by: KernelCI <[email protected]> Reported-by: Nick Desaulniers <[email protected]> Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Link: ClangBuiltLinux/linux#1054 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 49b65b9 commit 4735a03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,9 +1539,9 @@ config ARM64_PTR_AUTH
15391539
default y
15401540
depends on !KVM || ARM64_VHE
15411541
depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1542-
# GCC 9.1 and later inserts a .note.gnu.property section note for PAC
1542+
# Modern compilers insert a .note.gnu.property section note for PAC
15431543
# which is only understood by binutils starting with version 2.33.1.
1544-
depends on !CC_IS_GCC || GCC_VERSION < 90100 || LD_VERSION >= 233010000
1544+
depends on LD_IS_LLD || LD_VERSION >= 233010000 || (CC_IS_GCC && GCC_VERSION < 90100)
15451545
depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
15461546
depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
15471547
help

0 commit comments

Comments
 (0)