[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220907045907.484043-6-ndesaulniers@google.com>
Date: Tue, 6 Sep 2022 21:59:07 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Michal Marek <michal.lkml@...kovi.net>,
Nathan Chancellor <nathan@...nel.org>,
Tom Rix <trix@...hat.com>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev, x86@...nel.org,
Dmitrii Bundin <dmitrii.bundin.a@...il.com>,
Fangrui Song <maskray@...gle.com>,
Alexey Alexandrov <aalexand@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Greg Thelen <gthelen@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH v3 5/5] Makefile.debug: set -g unconditional on CONFIG_DEBUG_INFO_SPLIT
Dmitrii, Fangrui, and Mashahiro note:
Before GCC 11 and Clang 12 -gsplit-dwarf implicitly uses -g2.
Fix CONFIG_DEBUG_INFO_SPLIT for gcc-11+ & clang-12+ which now need -g
specified in order for -gsplit-dwarf to work at all.
-gsplit-dwarf has been mutually exclusive with -g since support for
CONFIG_DEBUG_INFO_SPLIT was introduced in
commit 866ced950bcd ("kbuild: Support split debug info v4")
I don't think it ever needed to be.
Link: https://lore.kernel.org/lkml/20220815013317.26121-1-dmitrii.bundin.a@gmail.com/
Link: https://lore.kernel.org/lkml/CAK7LNARPAmsJD5XKAw7m_X2g7Fi-CAAsWDQiP7+ANBjkg7R7ng@mail.gmail.com/
Link: https://reviews.llvm.org/D80391
Cc: Andi Kleen <ak@...ux.intel.com>
Reported-by: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
Reported-by: Fangrui Song <maskray@...gle.com>
Reported-by: Masahiro Yamada <masahiroy@...nel.org>
Suggested-by: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
---
Changes v2 -> v3:
* Pick up Nathan's RB tag.
Changes v1 -> v2:
* Add reference to 866ced950bcd, cc Andi, in commit message.
scripts/Makefile.debug | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug
index 2845145c1220..c20f8f2e76bf 100644
--- a/scripts/Makefile.debug
+++ b/scripts/Makefile.debug
@@ -1,10 +1,4 @@
-DEBUG_CFLAGS :=
-
-ifdef CONFIG_DEBUG_INFO_SPLIT
-DEBUG_CFLAGS += -gsplit-dwarf
-else
-debug-cflags-y += -g
-endif
+DEBUG_CFLAGS := -g
debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) += -gdwarf-4
debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) += -gdwarf-5
@@ -15,6 +9,8 @@ ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy)
KBUILD_AFLAGS += $(addprefix -Wa$(comma), $(debug-flags-y))
endif
+debug-flags-$(CONFIG_DEBUG_INFO_SPLIT) += -gsplit-dwarf
+
ifdef CONFIG_DEBUG_INFO_REDUCED
DEBUG_CFLAGS += -fno-var-tracking
ifdef CONFIG_CC_IS_GCC
--
2.37.2.789.g6183377224-goog
Powered by blists - more mailing lists