From 3ecad14bac4f60412243ba10431c202aa7ad3c03 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Tue, 3 Nov 2020 16:53:41 -0800 Subject: [PATCH] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Clang's integrated assembler produces the warning for assembly files: warning: DWARF2 only supports one section per compilation unit If -Wa,-gdwarf-* is unspecified, then debug info is not emitted. This will be re-enabled for new DWARF versions in a follow up patch. Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with LLVM=1 LLVM_IAS=1 for x86_64 and arm64. Cc: Link: https://github.com/ClangBuiltLinux/linux/issues/716 Reported-by: Nathan Chancellor Suggested-by: Dmitry Golovin Suggested-by: Sedat Dilek Signed-off-by: Nick Desaulniers --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index ee2284a5cad2e6..603826c458b1c9 100644 --- a/Makefile +++ b/Makefile @@ -828,7 +828,9 @@ else DEBUG_CFLAGS += -g endif +ifndef LLVM_IAS KBUILD_AFLAGS += -Wa,-gdwarf-2 +endif ifdef CONFIG_DEBUG_INFO_DWARF4 DEBUG_CFLAGS += -gdwarf-4