Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2091666pxb; Fri, 29 Jan 2021 12:59:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqzNro8Mn3nczEshCn9JztFDl2n0mgQuL/kVrnCCUXxO5HXYCy/2VqixZhEX/3vOte2jdl X-Received: by 2002:a05:6402:1bcc:: with SMTP id ch12mr7271863edb.283.1611953981635; Fri, 29 Jan 2021 12:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611953981; cv=none; d=google.com; s=arc-20160816; b=Q+Mnr61lYz708HGtK4WvF/Ma2n15Gz4eWD5VzzZMmLxra6XyRQlzY43XGCpiOp3qWT oayavs0/tKbMPwNqaoLtCiOhzRPeMn8aHoig3/r2jp4O2kM5ooWd4pcSBQEvBH3o4ryE rOkBXfiQs02jMM+sfkizrtQfZrMPshx95l4TFLV/jmaOayut62aGrRxXbR27rNfdNGB9 beSV1xfbWCrtF8D4rtmYcjJ5waSXeiPGx7l7lgM2GotCvWVjqC3YO+qpMZhbNsG+hjyq 9s7scx90rov64FLxBaaVwSH6YPOPl/JDc77dTTLKLUFCRSsGsQzANR9Mp8JcsAfvQoQ3 IAeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=R+KMZZPkYrf5pIZgpahKbDaW5WeKXpZb6/M/9IMIgPI=; b=L2T5Aye+PtwfbHhiXqzYfrg+x6HIPr2Z3clp/Ez+vr8Mr/Sn5wP3fej7iOkiChHXW4 okxf+Bd4qWgBcSoIFDYxhl4WBSJYesKs45L03Q6JRaWrYL0TZy6YL+3AvPYwnJ9tPMlQ +t7GbVdbVPtYHkN6eXnRpi9XoTXfQmmUpu+0VfDQVqNJozOyqa7FjqegP1lcYkxXc+e3 Ht71PnhkXSgLy5SDpYyFN4SqI3qQh2OUpoTxWypAPj3yRvP5JbPPwMu+o7SgROgyRf1O M2pavexA3HlMo0gOZoNGdYvkk+OApmCAwMtrblNyrPwCGdL6WvSL4TGwKJttVA53SPSk fD2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YBeGa0TN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si5964735edu.258.2021.01.29.12.59.16; Fri, 29 Jan 2021 12:59:41 -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=@google.com header.s=20161025 header.b=YBeGa0TN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233281AbhA2U6Q (ORCPT + 99 others); Fri, 29 Jan 2021 15:58:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233200AbhA2U6M (ORCPT ); Fri, 29 Jan 2021 15:58:12 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648A5C061574 for ; Fri, 29 Jan 2021 12:57:32 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id f63so6972857pfa.13 for ; Fri, 29 Jan 2021 12:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R+KMZZPkYrf5pIZgpahKbDaW5WeKXpZb6/M/9IMIgPI=; b=YBeGa0TNfWKOAatmKVgE1R03aJoq8o7J78BB/JsQbdwVvIZZWw925PEA1Pahy6DXmP vZURKN7a6QdKZOQy6V5w9/PzIan3CDkn36PdZi7PjO9Y5pkEP/F72yaEczao4YkCMdmS swa3grBP1yJhVkervL8gug5wQwOQPXLkWAC9bKDVZb/tnh211x7LdZut9BZ6WzLsamC2 snTgzHLv5mCKOKAr2dkuxcJk0ykfTDZY55bkaFYRveBUOi9LS0eSkNTlrOrPdD1pFNVG oXmE7Y50Zxzh5rUmsyQ+pX1GmEgIbd5+PUiwsI9wiIGGAzXfzzqxi/mHEqIDMroVmeEn bLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R+KMZZPkYrf5pIZgpahKbDaW5WeKXpZb6/M/9IMIgPI=; b=SYiyY/JqG/5ccDJrEGw5e1rVV+SkP83QRwMoe3VuweHJQF8DV1N9/cMoYute3V+3jY NBTuNBODr5xYpWQHi+TsU6nc/HzKPFpFNSAu5mcDD6fTlHhIdwwhfc2QQzB8qtMHb8Ut gak46CutbycBHr1Rmu36jgZ6LER8UNBWc+xjNnpqt7wJIndao3KTCeYvXbl679rHpmDH jl0j9knIaw9bSwEMrXKEkEubfu5o7RoBwYMOoYp8UaDfwEC4o46cafuSJQXhmK/O7wcX ebBeKt1kjYczQfiTGPIDQ47lL3sRf3rh2q+D6Qf18/dPFNj22NHGyLrCAylLnBa1FNF6 hR8g== X-Gm-Message-State: AOAM531e4m2V4cobxfF10HOvdR9Z+nuFrE8pox87OOSE0X3QsBdkpekb ZuP7vqEym+SJWrTIMf7TJq1drxOJC1OwWRFdXCpQdw== X-Received: by 2002:a65:4201:: with SMTP id c1mr6366899pgq.10.1611953851665; Fri, 29 Jan 2021 12:57:31 -0800 (PST) MIME-Version: 1.0 References: <20210129194318.2125748-1-ndesaulniers@google.com> <20210129194318.2125748-2-ndesaulniers@google.com> <20210129201712.GQ4020736@tucnak> In-Reply-To: From: Nick Desaulniers Date: Fri, 29 Jan 2021 12:57:20 -0800 Message-ID: Subject: Re: [PATCH v6 1/2] Kbuild: make DWARF version a choice To: Jakub Jelinek , Masahiro Yamada , Arvind Sankar Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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