Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2111985pxb; Fri, 29 Jan 2021 13:36:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn30H2iQ8NIq22h09dXXu9SfabldnsqoWQK1WOl57HDh29UhQN1iHVAksD7HHbHQequyCE X-Received: by 2002:a17:906:653:: with SMTP id t19mr6605606ejb.44.1611956192611; Fri, 29 Jan 2021 13:36:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611956192; cv=none; d=google.com; s=arc-20160816; b=DSZnQzjPOgquvWcBcD4zQmbaEv3rpCvJD57FGpJ45gsukegFjRFh/qUcBM2/b9JUEN lcpKYT/8HprNPVViIEleVGdDmqEYSx8K9/FT0mSbqPyg8zJgg0RqS9+uLver25CmSCja a1mwyfRluULzsMPPiZQ1LttbDlcVgLtoBjnq4Omf7lxekMlFnJUbpegolxH/+Xp67+Fq 8IB3zIT0kxZLLkzJl3snXKaj5rdcoimPOcM9NRaj91bndUF11+ciscACP8I1r1pAB86U zZQ4nTXGxZmJt0fKaugnqt/TLAKceah3q/ayqbp6k5Fb9KXQzf/Q4/Ux+pIhk3Ogw086 p1sA== 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; bh=Cv/H+UXVfiojhZIcXbfkk/ErDokGpMJ0LpJMoYEpdpA=; b=F2EAlVROgz91i5T/9aH8UHBnR3T+YCtrUdlggMMy2+t30nZFXKhQ5MVaMMC79BZG1f 3nDrcYEBfVveNoAt4gPO+C9GQQQUjYU4nNG6981DwFzFj2VGRjO9KSt9B7xEOPAikfGY U77VnsLTAvP/4wSZwYqcK3mLTlXngN6etOR6tiuaipelkgka2Yx9FetK9zooC7ojViC5 KwJdxRQVqhDAW5n9MLaAoj5zDmIxbUSr9KX1ohCvHrxC0Exn7mhBEyYtjKiw/694f+JS uePGjQ6rNDdelw04ZabbfVIWJ4c8vZbHLkXACAWiIxGoPzLK9cOYUlcznu9MsmKMap1h qFnw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si6017880edd.70.2021.01.29.13.36.07; Fri, 29 Jan 2021 13:36:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233459AbhA2Vdw (ORCPT + 99 others); Fri, 29 Jan 2021 16:33:52 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:41231 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233484AbhA2Vdk (ORCPT ); Fri, 29 Jan 2021 16:33:40 -0500 Received: by mail-qk1-f177.google.com with SMTP id n15so10221050qkh.8; Fri, 29 Jan 2021 13:33:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Cv/H+UXVfiojhZIcXbfkk/ErDokGpMJ0LpJMoYEpdpA=; b=huVNdh3jcnf0KmkJ55zC+lEvxzqk+evPXJj0uifN5rEcLXg2IU+kN6nGGiS8lPzYZ/ K2QcZL9ozrbEs0PyIsgrq4/rMA1zdKFfJIcxsNhUF5D61onWFFtYmXaD5TIPPGeZXpL4 4lBPbtY03LqPk+/rzrrvFoD0i6QAivoVLIxTJLop4465Y0Zdp6X8B+SIr5KdqaHxM5T8 frf9SZ3YEVPIDZ10shgMqzmvr6h8iWbZHNA0bAFegrR45N239L/rJ9yQkJ3lI8bgHs4c K3ZqcJy0mmyHcr16B/xi3QQuCjS/k0whJaqPVlZ1ts6z1hBTvLrg2bgt3TzYtwzDBY39 oBmQ== X-Gm-Message-State: AOAM5308Lr0xmZetzqMhmkPlQ4M/qp5JHby2NBDmo2WFvH77kSQLhJpt 6ibD5X3I5JrUh+RS9BcQVs8= X-Received: by 2002:a37:cd5:: with SMTP id 204mr5672284qkm.410.1611955955712; Fri, 29 Jan 2021 13:32:35 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id 22sm7068680qke.123.2021.01.29.13.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 13:32:34 -0800 (PST) Date: Fri, 29 Jan 2021 16:32:32 -0500 From: Arvind Sankar To: Nick Desaulniers Cc: Jakub Jelinek , Masahiro Yamada , Nathan Chancellor , Andrew Morton , Sedat Dilek , LKML , clang-built-linux , Linux Kbuild mailing list , linux-arch , Fangrui Song , Caroline Tice , Nick Clifton , Yonghong Song , Jiri Olsa , Andrii Nakryiko , Arnaldo Carvalho de Melo , Nathan Chancellor Subject: Re: [PATCH v6 1/2] Kbuild: make DWARF version a choice Message-ID: References: <20210129194318.2125748-1-ndesaulniers@google.com> <20210129194318.2125748-2-ndesaulniers@google.com> <20210129201712.GQ4020736@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 12:57:20PM -0800, Nick Desaulniers wrote: > On Fri, Jan 29, 2021 at 12:19 PM Nick Desaulniers > wrote: > > > > On Fri, Jan 29, 2021 at 12:17 PM Jakub Jelinek wrote: > > > > > > On Fri, Jan 29, 2021 at 11:43:17AM -0800, Nick Desaulniers wrote: > > > > Modifies CONFIG_DEBUG_INFO_DWARF4 to be a member of a choice. Adds an > > > > explicit CONFIG_DEBUG_INFO_DWARF2, which is the default. Does so in a > > > > way that's forward compatible with existing configs, and makes adding > > > > future versions more straightforward. > > > > > > > > Suggested-by: Arvind Sankar > > > > Suggested-by: Fangrui Song > > > > Suggested-by: Nathan Chancellor > > > > Suggested-by: Masahiro Yamada > > > > Signed-off-by: Nick Desaulniers > > > > --- > > > > Makefile | 6 +++--- > > > > lib/Kconfig.debug | 21 ++++++++++++++++----- > > > > 2 files changed, 19 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/Makefile b/Makefile > > > > index 95ab9856f357..20141cd9319e 100644 > > > > --- a/Makefile > > > > +++ b/Makefile > > > > @@ -830,9 +830,9 @@ 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_DWARF2) := 2 > > > > +dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 > > > > +DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) > > > > > > Why do you make DWARF2 the default? That seems a big step back from what > > > the Makefile used to do before, where it defaulted to whatever DWARF version > > > the compiler defaulted to? > > > E.g. GCC 4.8 up to 10 defaults to -gdwarf-4 and GCC 11 will default to > > > -gdwarf-5. > > > DWARF2 is more than 27 years old standard, DWARF3 15 years old, > > > DWARF4 over 10 years old and DWARF5 almost 4 years old... > > > It is true that some tools aren't DWARF5 ready at this point, but with GCC > > > defaulting to that it will change quickly, but at least DWARF4 support has > > > been around for years. > > > > I agree with you; I also do not want to change the existing defaults > > in this series. That is a separate issue to address. > > Thinking more about this over lunch... > > I agree that DWARF v2 is quite old and I don't have a concrete reason > why the Linux kernel should continue to support it in 2021. > > I agree that this patch takes away the compiler vendor's choice as to > what the implicit default choice is for dwarf version for the kernel. > (We, the Linux kernel, do so already for implicit default -std=gnuc* > as well). > > I would not mind making this commit more explicit along the lines of: > """ > If you previously had not explicitly opted into > CONFIG_DEBUG_INFO_DWARF4, you will be opted in to > CONFIG_DEBUG_INFO_DWARF2 rather than the compiler's implicit default > (which changes over time). > """ > If you would rather see dwarf4 be the explicit default, that can be > done before or after this patch series, but to avoid further > "rope-a-dope" over getting DWARFv5 enabled, I suggest waiting until > after. > > If Masahiro or Arvind (or whoever) feel differently about preserving > the previous "don't care" behavior related to DWARF version for > developers who had previously not opted in to > CONFIG_DEBUG_INFO_DWARF4, I can drop this patch, and resend v7 of > 0002/0002 simply adding CONFIG_DEBUG_INFO_DWARF5 and making that and > CONFIG_DEBUG_INFO_DWARF4 depend on ! each other (I think). But I'm > going to suggest we follow the Zen of Python: explicit is better than > implicit. Supporting "I choose not to choose (my dwarf version)" > doesn't seem worthwhile to me, but could be convinced otherwise. > -- > Thanks, > ~Nick Desaulniers Given what Jakub is saying, i.e. it was previously impossible to get dwarf2 with gcc, and you get dwarf4 whether or not DEBUG_INFO_DWARF4 was actually selected, we should make the default choice DEBUG_INFO_DWARF4 with the new menu to avoid surprising users. We should probably just drop DWARF2 and make the menu in this patch have only DWARF4, and then add DWARF5 as the second choice. The menu is still a good thing for future-proofing even if it only has two options currently. Thanks.