From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB131C433DB for ; Sat, 30 Jan 2021 01:09:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E77564DE1 for ; Sat, 30 Jan 2021 01:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232976AbhA3BI4 (ORCPT ); Fri, 29 Jan 2021 20:08:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232997AbhA3A4i (ORCPT ); Fri, 29 Jan 2021 19:56:38 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86F6FC061788 for ; Fri, 29 Jan 2021 16:44:08 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id c12so12062505ybf.1 for ; Fri, 29 Jan 2021 16:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=e8ediMGbRKukecpLwO0eR0sbXZYBrlkFjlLmuC8GnoE=; b=fEyFzt3KHtoL6uGy0iZx8DvfLSlWMOs9K+nvo6MTXB4KKESIT3QfMhTqnnlNqCo2wx Vv8lttyIGu0PEa848lroNrZSNvRoXp+fHVC2A3nKhCZMllY+PKdRoMn1Vea3HRFGBgoT ANNgdC8oU7mEwR2Q1iyP97cMyy7NZqyjQZm9VmcjzvE7a1yLXDl+xBlolhJa02hdLFo/ EcDmrfTncaAX7EmA9Oo78pfzv7J8725gpteecb9oVgY3D1nBcMxPdlo0CaNzSvH6I4UF gXimS8DkkshvToLySWby18nrU/+94IUBHynNqo2209XIHHe7jjbtq+NV4CYx57+CF49i dK8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=e8ediMGbRKukecpLwO0eR0sbXZYBrlkFjlLmuC8GnoE=; b=YO0m8elTib2YET2PoLcAXItCZiPpftoifFbRg1j9AR1GFlUFLJdpG11wmOBrQDBg6b CsJMQjtcxbYeLcQAuvzJPNuYOA2zLe3tXvmJPxmPtJWcObRROEOo1I3U1I62e107cnJY 0NdHUTcAdad5hhndCoYGTHWcQlEVSEaQKu6mUjhA9UkgbUOGGm35ZYN1vb5vnNM/HTNq 58R6cdVEYAa5uMAWUpZ2PmDskDBqj2+YDUXjCxgSLY4VY1X9kUO1oJxpjJWqKvkaadqK x4/OPcvZvCyUVr6vhO+3n6OBx2ys3hSl+kzK1WsUaj2Ujl3mRzGUt8+fiXiLM1i7QsdB pfHQ== X-Gm-Message-State: AOAM531qhA4wkuju5gtTvPcLNEnNmWFltpkwcv9mMr10vixAHNWOX8kB sOVsQCcfoGT4+mS1ykIeQjpuS/HGfQKEOLTeq0U= X-Google-Smtp-Source: ABdhPJxM+p5XwbuYGK6EpDfDaxgYt7Be1GcIn8X1grBEIql7ANp7rNTvPHoFhNKDxI107oNYdXu7/tcPEgPlRKI/Yns= Sender: "ndesaulniers via sendgmr" X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a25:d293:: with SMTP id j141mr9709920ybg.56.1611967447754; Fri, 29 Jan 2021 16:44:07 -0800 (PST) Date: Fri, 29 Jan 2021 16:44:00 -0800 In-Reply-To: <20210130004401.2528717-1-ndesaulniers@google.com> Message-Id: <20210130004401.2528717-2-ndesaulniers@google.com> Mime-Version: 1.0 References: <20210130004401.2528717-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog Subject: [PATCH v7 1/2] Kbuild: make DWARF version a choice From: Nick Desaulniers To: Masahiro Yamada Cc: Nathan Chancellor , Andrew Morton , Sedat Dilek , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, Jakub Jelinek , Fangrui Song , Caroline Tice , Nick Clifton , Yonghong Song , Jiri Olsa , Andrii Nakryiko , Arnaldo Carvalho de Melo , Arvind Sankar , Nick Desaulniers , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modifies CONFIG_DEBUG_INFO_DWARF4 to be a member of a choice which is the default. Does so in a way that's forward compatible with existing configs, and makes adding future versions more straightforward. GCC since ~4.8 has defaulted to this DWARF version implicitly. Suggested-by: Arvind Sankar Suggested-by: Fangrui Song Suggested-by: Nathan Chancellor Suggested-by: Masahiro Yamada Signed-off-by: Nick Desaulniers --- Makefile | 5 ++--- lib/Kconfig.debug | 16 +++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 95ab9856f357..d2b4980807e0 100644 --- a/Makefile +++ b/Makefile @@ -830,9 +830,8 @@ ifneq ($(LLVM_IAS),1) KBUILD_AFLAGS += -Wa,-gdwarf-2 endif -ifdef CONFIG_DEBUG_INFO_DWARF4 -DEBUG_CFLAGS += -gdwarf-4 -endif +dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 +DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) ifdef CONFIG_DEBUG_INFO_REDUCED DEBUG_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \ diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e906ea906cb7..94c1a7ed6306 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -256,13 +256,19 @@ config DEBUG_INFO_SPLIT to know about the .dwo files and include them. Incompatible with older versions of ccache. +choice + prompt "DWARF version" + help + Which version of DWARF debug info to emit. + config DEBUG_INFO_DWARF4 - bool "Generate dwarf4 debuginfo" + bool "Generate DWARF Version 4 debuginfo" help - Generate dwarf4 debug info. This requires recent versions - of gcc and gdb. It makes the debug information larger. - But it significantly improves the success of resolving - variables in gdb on optimized code. + Generate DWARF v4 debug info. This requires gcc 4.5+ and gdb 7.0+. + It makes the debug information larger, but it significantly + improves the success of resolving variables in gdb on optimized code. + +endchoice # "DWARF version" config DEBUG_INFO_BTF bool "Generate BTF typeinfo" -- 2.30.0.365.g02bc693789-goog