• Mark Brown's avatar
    arm64: Depend on newer binutils when building PAC · 4dc9b282
    Mark Brown authored
    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 15cd0e67 (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: default avatarKernelCI <bot@kernelci.org>
    Reported-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Link: https://github.com/ClangBuiltLinux/linux/issues/1054
    Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
    4dc9b282
Kconfig 62.9 KB