Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 via aarch64 #1054

Closed
nickdesaulniers opened this issue Jun 17, 2020 · 15 comments
Closed

unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 via aarch64 #1054

nickdesaulniers opened this issue Jun 17, 2020 · 15 comments
Assignees
Labels
[ARCH] arm64 This bug impacts ARCH=arm64 [FEATURE] PAC Related to building the kernel with ARM v8.3 Pointer Authentication Code support [Reported-by] KernelCI Reported-by: kernelci.org bot <bot@kernelci.org>

Comments

@nickdesaulniers
Copy link
Member

cc @DanielKristofKiss @broonie @kbeyls

our clang-10 arm64 builds on kernel CI are getting flooded with

aarch64-linux-gnu-ar: warning: <foo>.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000

I also noticed the warning from gdb:

unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 via aarch64

I assume we just need to refine our test in Kconfig for whether the tools support this note property? @DanielKristofKiss mentioned being familiar with the note; can you help recommend a way to feature test support?

@nickdesaulniers nickdesaulniers added [ARCH] arm64 This bug impacts ARCH=arm64 [FEATURE] PAC Related to building the kernel with ARM v8.3 Pointer Authentication Code support [Reported-by] KernelCI Reported-by: kernelci.org bot <bot@kernelci.org> labels Jun 17, 2020
@nickdesaulniers
Copy link
Member Author

Since the warning appears to be coming from aarch64-linux-gnu-ar, I would have guessed that

# foo.s
.set NT_GNU_PROPERTY_TYPE_0, 5
.set GNU_PROPERTY_AARCH64_FEATURE_1_AND, 0xc0000000

        .pushsection .note.gnu.property, "a"
        .align  3
        .long   2f - 1f
        .long   6f - 3f
        .long   NT_GNU_PROPERTY_TYPE_0
1:      .string "GNU"
2:
        .align  3
3:      .long   GNU_PROPERTY_AARCH64_FEATURE_1_AND
        .long   5f - 4f
4:
        .long   0
5:
        .align  3
6:
        .popsection
$ aarch64-linux-gnu-as foo.s -o foo.o
$ aarch64-linux-gnu-ar cDPrsT foo.a foo.o

would've reproduced. I tested with binutils 2.27, but couldn't reproduce with that.

@nickdesaulniers
Copy link
Member Author

Since the warning appears to be coming from aarch64-linux-gnu-ar

nvm, the log has warnings from:

  • aarch64-linux-gnu-strip
  • aarch64-linux-gnu-objdump
  • aarch64-linux-gnu-objcopy
  • aarch64-linux-gnu-ar
  • aarch64-linux-gnu-ld
  • aarch64-linux-gnu-nm

So it seems that for some version of binutils, none of the utilities understand this note.

For the assembler file not reproducing, I wonder if Clang is emitting these notes?

@nickdesaulniers
Copy link
Member Author

0xc0000000 shows up in https://github.com/llvm/llvm-project/blob/55d53d4f5448db87ab0bec903be94b696c8ed3e8/llvm/include/llvm/BinaryFormat/ELF.h#L1446 and is used in AArch64AsmPrinter::emitStartOfAsmFile.

@DanielKristofKiss
Copy link

This warning is caused by the .note.gnu.property. [1]
Both toolchain should emit this section for PAC/BTI.
Since GCC 9.1 the .note.gnu.property section is added.
LLVM 10 does the same: https://reviews.llvm.org/rGd53e61863d48a07ce285d5b0a36abc67583023bd

The above reproducer works with binutils 2.30 for me.
Binutils supports it from version 2.33.1.
As I see the version check added only for GCC.
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git/+/refs/tags/v5.8-rc1/arch/arm64/Kconfig#1523

Maybe that check should be there globally if the gnu-binutils are used.
LLVM utils support it since LLVM 9 as I know, I tested with LLVM10.0.1 so that should work.

[1] Special Sections at
https://developer.arm.com/docs/ihi0056/g/elf-for-the-arm-64-bit-architecture-aarch64-abi-2019q4-documentation

@DanielKristofKiss
Copy link

#844 is a similar issue.

@broonie
Copy link

broonie commented Jun 18, 2020

I've done a patch adding the check for binutils - will put it on the list shortly. These binutils version checks will need revisiting for lld support. I've not made the check global since some versions of GCC don't emit the note and therefore don't need the newer binutils.

@nickdesaulniers nickdesaulniers added the [PATCH] Submitted A patch has been submitted for review label Jun 18, 2020
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jun 18, 2020
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.

In commit 15cd0e6 (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 add an explicit binutils version check for
clang too.

Link: ClangBuiltLinux#1054
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
fengguang pushed a commit to 0day-ci/linux that referenced this issue Jun 19, 2020
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 15cd0e6 (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.

Link: ClangBuiltLinux#1054
Reported-by: KernelCI <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
@nickdesaulniers
Copy link
Member Author

@nickdesaulniers nickdesaulniers added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Jun 23, 2020
ruscur pushed a commit to ruscur/linux that referenced this issue Jun 24, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Jun 26, 2020

Cool, that dropped our number of warnings down from >29k to 149. It looks like we might still have an issue in EFI libstub:

aarch64-linux-gnu-strip: warning: drivers/firmware/efi/libstub/lib-ctype.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
aarch64-linux-gnu-objdump: warning: drivers/firmware/efi/libstub/lib-ctype.stub.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
aarch64-linux-gnu-objcopy: warning: drivers/firmware/efi/libstub/lib-ctype.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
aarch64-linux-gnu-ar: warning: drivers/firmware/efi/libstub/lib-ctype.stub.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000

I didn't see any PAC related CFLAGS in drivers/firmware/efi/libstub/Makefile. IIUC, drivers/firmware/efi/libstub/lib-ctype.o comes from lib/ctype.o? I don't see any modifications to CFLAGS_ctype.o in lib/Makefile that might accidentally modify any flags. Maybe there's a missing preprocessor guard on CONFIG_ARM64_PTR_AUTH being included in lib/ctype.c? There's not much to that file, but maybe some of the headers?

cc @ardbiesheuvel

@kees
Copy link

kees commented Jun 28, 2020

Yeah, I think that's the same problem as #1068 : non-code object files are getting GNU_PROPERTY_TYPEs emitted.

9034725985 pushed a commit to continuousimprovement/linux-rc that referenced this issue Jul 4, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux/linux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
@nickdesaulniers
Copy link
Member Author

The Clang-10 release has finished, and I wouldn't consider this a blocker. Clang-10 will ship with this known issue. We can either choose to disable PAC w/ clang-10 (@broonie notes that there's no codegen bugs per se, just annoying build warnings), or move kernel CI builds to LLVM=1 (which I'd rather do).

I'd still like to land the LLVM patches for clang-11 before closing this; just noting this will be a known issue w/ Clang 10.

@broonie
Copy link

broonie commented Jul 20, 2020

The kernel already disables PAC on these systems - the bug is that clang emits the PAC/BTI notes unconditionally for some input files, regardless of what it's been asked to produce or what the linker on the system can cope sensibly with.

fifteenhex pushed a commit to fifteenhex/linux that referenced this issue Jul 25, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
fifteenhex pushed a commit to fifteenhex/linux that referenced this issue Jul 28, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
fifteenhex pushed a commit to fifteenhex/linux that referenced this issue Jul 28, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
fifteenhex pushed a commit to fifteenhex/linux that referenced this issue Jul 29, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
fifteenhex pushed a commit to fifteenhex/linux that referenced this issue Aug 1, 2020
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 15cd0e6 (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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
@nathanchance
Copy link
Member

@nickdesaulniers you mentioned there was some follow up that was needed for clang-11 with this? Otherwise, are we good to close this up?

@nickdesaulniers
Copy link
Member Author

A fix hasn't landed in LLVM yet. #1068 . Let's close this and follow up there.

@nickdesaulniers nickdesaulniers removed the [PATCH] Accepted A submitted patch has been accepted upstream label Aug 28, 2020
Kendrenogen pushed a commit to Kendrenogen/android_kernel_lge_sm8150 that referenced this issue Mar 26, 2024
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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux/linux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Kendrenogen pushed a commit to Kendrenogen/android_kernel_lge_sm8150 that referenced this issue May 7, 2024
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 <bot@kernelci.org>
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: ClangBuiltLinux/linux#1054
Link: https://lore.kernel.org/r/20200619123550.48098-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] arm64 This bug impacts ARCH=arm64 [FEATURE] PAC Related to building the kernel with ARM v8.3 Pointer Authentication Code support [Reported-by] KernelCI Reported-by: kernelci.org bot <bot@kernelci.org>
Projects
None yet
Development

No branches or pull requests

5 participants