Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3904808pxu; Mon, 30 Nov 2020 12:50:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyl4jkcxZdUMNMPx5y6RRbLtwU06pacu0tGFDzavHlZaFHLdOFGcEt+5fge0w7JKM2cUlyy X-Received: by 2002:a50:d493:: with SMTP id s19mr11411162edi.104.1606769408529; Mon, 30 Nov 2020 12:50:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606769408; cv=none; d=google.com; s=arc-20160816; b=BI5A1p/sGJifE4Ljc3bIaOrvBxqMkev9xorsz2vW3qmI/HeA+eTaeS23LqQc8JX7bX GgSQIXGaRhMgc0qwAN4cPTgaZ8Y0/NCiF7Au87Z+C0D6XexS+ndgIjyvyCmYV1sRfiu0 l5PydKOh7lJ37mB2qDB1SavO/cZxnVZBBAHle1TDB88g2G3gDM8cjIB+k8P95JSkpRRq 0xHYZKID7bqPX9ZlfgG9INMELMVk/9qD9o0AtNefUUSljJ+rt4soB0UTD4Twulx/FgNW Y68ZB0v3m6Siyt7znV54IiNGrRqAv9rQtrqWCfGoTTsvwjtD1UGUGYZvvi5EYbaqm8+h 5wYg== 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=xHk+vscpe9u8SLq69FjicFeg9t4MWKyCiDt4jUtaF7o=; b=O9ez0+GSyZrlU9gL1AHOP0lE6NIBR4cJRrr6RVZEmrxXvmabuuLfvuCrHuXT+RiNBX su8hU2otPjPamPX/CiQCAn37ZjaJPhz4bstfJXmP4qEBLU5bPRAzws6yrMuugHBjzqmq 4HMO+q+aA/hegqaWsPuwGuXnqde76L+NYeitIy+nS5cfVmHPNWnysvOjDsC0wEYZQ9uo EdcKruvyIWvVp7qE77KT+xap2nBHU4WHfkZqQIr14uxc6LVclZR39KM/sMsHvZJ8yaGJ 4FS8CL+i1Rgr7YZ6Pa7mdNaZJAZ4fs8blGx1djbMwbTieV5jZ8vCw0dTx6A/ErDgCHmV kHCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cpaTdK87; 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 bm26si985966edb.528.2020.11.30.12.49.44; Mon, 30 Nov 2020 12:50:08 -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=cpaTdK87; 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 S1729898AbgK3UqN (ORCPT + 99 others); Mon, 30 Nov 2020 15:46:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727309AbgK3UqN (ORCPT ); Mon, 30 Nov 2020 15:46:13 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5FBBC0613CF for ; Mon, 30 Nov 2020 12:45:27 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id hk16so324714pjb.4 for ; Mon, 30 Nov 2020 12:45:27 -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=xHk+vscpe9u8SLq69FjicFeg9t4MWKyCiDt4jUtaF7o=; b=cpaTdK87VnoZo3+5Ml8WwaCfUpvHSdiM4hpMObvwg6dH5dhNpD8fdzY3d9qit5fHEE w+d2qn8sIHA7fMwtmGkheGDLfX8/TuIghQQFQ5cbcPj/E7AFxbbjiwcWX1D4qVZ1mSUo ye+hcQVcv6752V31wWD7Izfcqsx+1aTqdK57ejHZCXr727bO7x3LoRTzZgS4oCaVXkOE +KkVH7Niocm/O55zIBRy/KirzfJS/jrunu/TSrSGltX7eU3h/a3ph16g3HfrXiNj/a6Y Ua/5/89W2Q3z7IHqbUyFo+dvBpLB/rrw1C4Y2boBdFiXwPHXVkKiudfwFlckeQOARBuQ B+3A== 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=xHk+vscpe9u8SLq69FjicFeg9t4MWKyCiDt4jUtaF7o=; b=LF/ic+GFAOrPP8Fgbi0lfzW7k3BQJmmBNV4Q4nTQrpt032ESnwJQQfXr3gphwzFw/F RC2Bq4+uWxva7g731/vX/nig4dSQppwIFvFyF1tGNjpxJ/NA9xnilho4q/yUDvrsDtSm Zj8CdvQetsROfZ63JwFloEzQ+IALJN6CTGGlbH+SR9rKzUglMFgen9law6l1Y4k6JvvH z15Ru81+ePbb3JC72ECy+5kzmo2FuyPJ6toi0vPJHQNHegslgTzoO5Cn0vkq+XwLK9ku Ten5aK8tR7MHbUrnJEH+uQQZ+9eyfPj2EbdGet/S9RhWICEb25YaVlrtlodh7wd/djyl 2gmA== X-Gm-Message-State: AOAM531z9JDq+Y59Uq8lMlpHRy08Wvx4pdJv40hleXnNuNduLjUX/7xG 5UL/x4haFRDCYHGMf8r/rQ0LBe6+bRzGhTvqq3zOLw== X-Received: by 2002:a17:902:221:b029:d8:f938:b112 with SMTP id 30-20020a1709020221b02900d8f938b112mr20683673plc.10.1606769126862; Mon, 30 Nov 2020 12:45:26 -0800 (PST) MIME-Version: 1.0 References: <20201104005343.4192504-1-ndesaulniers@google.com> <20201104005343.4192504-4-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Mon, 30 Nov 2020 12:45:15 -0800 Message-ID: Subject: Re: [PATCH v2 3/4] Kbuild: make DWARF version a choice To: Masahiro Yamada Cc: Jakub Jelinek , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-toolchains@vger.kernel.org, clang-built-linux , Fangrui Song , Nathan Chancellor , Sedat Dilek , Dmitry Golovin , Alistair Delva Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 10:05 AM Masahiro Yamada wrote: > > On Wed, Nov 4, 2020 at 9:53 AM 'Nick Desaulniers' via Clang Built > Linux 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: Fangrui Song > > Suggested-by: Masahiro Yamada > > Signed-off-by: Nick Desaulniers > > --- > > Makefile | 14 ++++++++------ > > lib/Kconfig.debug | 19 +++++++++++++++---- > > 2 files changed, 23 insertions(+), 10 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index 75b1a3dcbf30..e23786a4c1c7 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -826,12 +826,14 @@ else > > DEBUG_CFLAGS += -g > > endif > > > > -ifndef LLVM_IAS > > -KBUILD_AFLAGS += -Wa,-gdwarf-2 > > -endif > > - > > -ifdef CONFIG_DEBUG_INFO_DWARF4 > > -DEBUG_CFLAGS += -gdwarf-4 > > +dwarf-version-$(CONFIG_DEBUG_INFO_DWARF2) := 2 > > +dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 > > +DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) > > +ifneq ($(dwarf-version-y)$(LLVM_IAS),21) > > +# Binutils 2.35+ required for -gdwarf-4+ support. > > +dwarf-aflag := $(call as-option,-Wa$(comma)-gdwarf-$(dwarf-version-y)) > > +DEBUG_CFLAGS += $(dwarf-aflag) > > This changes the behavior. > > For the Dwarf-2 case, > > Previously, -gdwarf-2 was passed to $(CC), > so the debug info was generated by gcc. > > Now, -Wa,-gdwarf-2 is passed to $(CC). > -gdwarf-2 is handled by GNU as. > So, the source info points to /tmp/.s > instead of the original .c file. > > > > Handling the Dwarf capability is very complicated. > > Are you still working for v3? Yes, I plan to revisit the series based on all of the feedback thus far. Lately I'm focused on enabling LLVM_IAS=1 for Android; but I would like to see this land so that the Linux kernel may provide coverage and feedback to the toolchain developers for DWARF v5 (as well as reduced binary image sizes). Maybe later this week I'll have time to revisit. -- Thanks, ~Nick Desaulniers