Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2427256pxb; Sat, 30 Jan 2021 02:13:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKEacnZ1bSwRQMdsy8AY+6JMRr2iUX7NEFHTrrUhHCyqsjN8WCO7OdFvlqkNm67GtCXu+s X-Received: by 2002:a17:906:5495:: with SMTP id r21mr8385694ejo.59.1612001631917; Sat, 30 Jan 2021 02:13:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612001631; cv=none; d=google.com; s=arc-20160816; b=SVwS+fkDeA0k7yT21NnHU80W0y8ZlNp13/FMadfx+VaLcKOn+UxYDs5CE79cnmwzuD r8PxqF+YF1UlaBzpK7N+Ve2irKa66YdAEjy5FD6/wURmCQgmDa429xHhxBB81TZ+rfUU zPT5l79Qu9Y1+v3FaQu46J7zkTj6YOJS3N1OBJljSgnLAUhblU1OZVmMJmyXlrFUTv1w m1VpHP7pmdiDAq6uJaywz31fMr8eUk5YM7Ez32N0KVhqy2edGJOvlQc2Cwgwpcygq4ot Zg5ghoEaJ4u2o2m+WVwxyeHsA/3Bpf3eZCq8G4hLFH1Iv+Tm1FY5BlO7ZrbGbG+s1SMH DRpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RmkZ8qbysqQEPXI0jUHotcKQ8yyG9MSMDOBJanz9OHk=; b=OwOCFQAg9vfb6kk4h5MpGOZ7f3SUvY7rGpgB+3anWilnsDSxxQJ9bh2P/wAcJ++9S/ eKGqH/onYZLY6c9ds7rXPpaIldBDBwK6WtOUjVFDaayZCz8khCJWg0GPFf8DxnSsZ2m4 6yDxg2ph1wpwGt1IprIF41OcJ93pyV5idKgfP93bLsVU96XHr63KuCPvAmm0ULk0jccD b1eP8C6m7mgUYutqOGFXWz+Ze3+BZd8KSQZP/v5yIib3Yr6D34eeCjyTUHvZru4TJwH4 N1eNAa3utUxAhB6MN4btPpGoG4RrmzndMpG3D6268hzCjs+gfnh0B3HwIKF/YvvC2iEY f07g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C1JKUKDR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr3si578708ejb.194.2021.01.30.02.13.26; Sat, 30 Jan 2021 02:13:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C1JKUKDR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbhA3KMN (ORCPT + 99 others); Sat, 30 Jan 2021 05:12:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:56974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232691AbhA3BxK (ORCPT ); Fri, 29 Jan 2021 20:53:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C79C964DA1; Sat, 30 Jan 2021 01:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611971545; bh=QD1brHT/zuOqCDivveiwXFVorG1yCZ8pm304EyrgY0E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C1JKUKDRjf5UBTHPYfc/X9l82lp25ebqm9xoQZMENT8ZUjLUHh1D1WFTJ705hZ5TM EnyS/G1rcEYn/8nKxB1U9qPTnsw9OZUfp4qDBf2NzoSeYm6ymmi7FdxWp/955b+AdJ 0gKnEKEDa/hKUoBTRO4DzeE8I2l35EqeXMhJZhx2rld5E/3+EWPmN310hENeGoI6Dm bklzv0TJfPp/dA3hbv9rj4luy5EkwD0jx0ASf4O3Hp0F4FAOdSFCLntrFUUOvBvxWY lqgfCHzSY0wIOaMXWAQTFUYsev1zwTBBpPI7J7ZrWKxVS4iac2JU89pYtiXHCbXUgt DhdL6swAHCuLw== Date: Fri, 29 Jan 2021 18:52:22 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Masahiro Yamada , 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 Subject: Re: [PATCH v7 1/2] Kbuild: make DWARF version a choice Message-ID: <20210130015222.GC2709570@localhost> References: <20210130004401.2528717-1-ndesaulniers@google.com> <20210130004401.2528717-2-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210130004401.2528717-2-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 04:44:00PM -0800, Nick Desaulniers wrote: > 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 One comment below: Reviewed-by: Nathan Chancellor > --- > 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 It is probably worth a comment somewhere that assembly files will still have DWARF v2. > 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 >