Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp690739pxb; Wed, 3 Feb 2021 15:31:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCeWFNWjeeNBdtESmmgPg6kpEbOv0uF3qoMq4zRfen6lCEO4PdbfGZB86xxp5c6dISL03Q X-Received: by 2002:a17:906:2e4f:: with SMTP id r15mr5500089eji.407.1612395091740; Wed, 03 Feb 2021 15:31:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612395091; cv=none; d=google.com; s=arc-20160816; b=PWZ6HdnYntgrqRJJdLhvg9C6cYDwpt41GipM08nJct0JIJyTRKeZ3xbEtm36dpSVEE vvydMoxJW9QhLQTIVTy0RzbHds7sbC1XPSWG6XzrZIl95gImesfkrsQNLvQ25WxjgcbP uJb/1YAPrBn9+1e6oHJszY/j0j5Ac326mDjwXIoqg3Aw08svqwOYbm7NZ9KQS4DgkM8+ TvENABp3y/95EU7HPU+bCaR78Muv5vFbBVgFcY0ATI7HLHq1uD0sSGqRYz0sS9ROrL+G dXYW2F/32znIxMpWMtWe1O9aMu+XiI1TH5Ic10JKomggr7TwZy+DLrgamSap/REdfSYB gXvw== 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=+eX+hFOL+CzxhxR9XSBHmfjn0y1EEXuMNIwlju1/yaQ=; b=MKOIV5IHbovOUgfhZqgAwhzVdbcs2ZVv76DVmkLRS4C9W/vl5gl6zjVAOpO691UMMN PnJ8aGaltbHPmBlinUE/sUy3GbRzf2tHsy7SWNXdqChOjeOiYWctJphS0PPBTELKpues 8LSKImTWbTtqWyLLQbWWxskRqFGGmUBiCnXJN/G8buqsJMaHNiKreI9G8Td2+ckltiiZ cVEoMzR/cwZPIQOrogylDQikOU+M1IsQlDA1iuL2udFVa6k06AGf7YsItIlIDF2zoSyE 1HKSo6mobh3nLxOpskmilSFH2BhZYfbGnQ3LoMb+KqPxlh5GEihci3YYbVSUO2sUoUiJ 16Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GCIJY1mP; 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 w17si2387313ejy.52.2021.02.03.15.31.07; Wed, 03 Feb 2021 15:31:31 -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=GCIJY1mP; 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 S233315AbhBCX2b (ORCPT + 99 others); Wed, 3 Feb 2021 18:28:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233362AbhBCX22 (ORCPT ); Wed, 3 Feb 2021 18:28:28 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 745A2C061788 for ; Wed, 3 Feb 2021 15:27:48 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id e9so730902plh.3 for ; Wed, 03 Feb 2021 15:27:48 -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=+eX+hFOL+CzxhxR9XSBHmfjn0y1EEXuMNIwlju1/yaQ=; b=GCIJY1mPpwom81hK+0og/pl+ty+bruNLoSFs6eBbr/UK3w1EV+KchotabN4dUoX5JV nqRtBEHnCYnWmTl5C4dLUFJOU+8RWIk1Enm5mSbSkKkKikUOc+ZSeaGMtY6DUjz5CvMM Jzk864oLOyfKp6vxnCQelH7zCrng3H0uf1S1JvGcXHo41Lfc/Pqv86EqXL54RSBXORyQ LZYoNQvPYaPN0WPstjOsfbUM3ONnBPr9cNWDDzHjl5ugnWPu+OCumNNfW0ZeOsJKmu2m o3JTzR75HY1DZWWcTSfByb5JfxcdwhkOdQZhPjfEH63BOdHWvg2/ExuSMjSJLozXfTUY lagw== 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=+eX+hFOL+CzxhxR9XSBHmfjn0y1EEXuMNIwlju1/yaQ=; b=IPLs/ZVGP2lwJJDEzG4D/S/OXeO+OCmLCjQS3MwCwuCtwBlDP1s6OfEYHhTg1000Yh IDj996gEJzZ5lCYkM28KDmotF5nMTRCQO5eViDSR7hlhM15FKQ3cWAMGGmlkduF2GcX9 3p5daG6rZEF7Wys1zqnKKZKExCbNQ+K0LX7XcPotaiEJW4g/Ep7rEgp5/OkeIc50kaN7 RRquBYqp8WCT6nzvWxXBBRN7pzM/LI49rZHfnkEVVySUTe9VSSO6IHL5agFW+F/W6/ZA jr3EDjfrIyPXeTJk075KjhauAH84hdiS/GoFihjoyWCasQgtD5iXq3gkmO6sDMNWBzu1 mdhw== X-Gm-Message-State: AOAM533uHCimLEPkzrhqdalRkoh4WpgoJSHJjepqSHZt3HFxlPIRF+kP 4eF3/CnUwNFDT84N1qo+nsjbzYCKm+AYoABe7v0oUw== X-Received: by 2002:a17:90a:db05:: with SMTP id g5mr5573673pjv.32.1612394867235; Wed, 03 Feb 2021 15:27:47 -0800 (PST) MIME-Version: 1.0 References: <20210130004401.2528717-1-ndesaulniers@google.com> <20210130004401.2528717-3-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Wed, 3 Feb 2021 15:27:34 -0800 Message-ID: Subject: Re: [PATCH v7 2/2] Kbuild: implement support for DWARF v5 To: Masahiro Yamada , Nick Clifton Cc: Nathan Chancellor , Andrew Morton , Sedat Dilek , Linux Kernel Mailing List , clang-built-linux , Linux Kbuild mailing list , linux-arch , Jakub Jelinek , Fangrui Song , Caroline Tice , Yonghong Song , Jiri Olsa , Andrii Nakryiko , Arnaldo Carvalho de Melo , Arvind Sankar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 3, 2021 at 3:07 PM Masahiro Yamada wrote: > > Nick, the patch set is getting simpler and simpler, > and almost good enough to be merged. I agree. I think Sedat pointed out a binutils 2.35.2 release; thanks to Nick Clifton for that. > > > Please let me ask two questions below. > > There has been a lot of discussion, and > I might have missed the context. > > > --- a/lib/Kconfig.debug > > +++ b/lib/Kconfig.debug > > @@ -268,6 +268,24 @@ config DEBUG_INFO_DWARF4 > > It makes the debug information larger, but it significantly > > improves the success of resolving variables in gdb on optimized code. > > > > +config DEBUG_INFO_DWARF5 > > + bool "Generate DWARF Version 5 debuginfo" > > + depends on GCC_VERSION >= 50000 || CC_IS_CLANG > > + depends on CC_IS_GCC || $(success,$(srctree)/scripts/test_dwarf5_support.sh $(CC) $(CLANG_FLAGS)) > > Q1. > > This "CC_IS_GCC ||" was introduced by v4. > > GCC never outputs '.file 0', which is why > this test is only needed for Clang, correct? This test script is only needed when compiling with clang but without its integrated assembler. It checks that when clang is used as the driver, but GAS is used as the assembler, that GAS will be able to decode the DWARF v5 assembler additions Clang will produce without needing an explicit -Wa,-gdwarf-5 flag passed. Technically, it is unnecessary for `LLVM=1 LLVM_IAS=1` or `CC=clang LLVM_IAS=1` (ie. clang+clang's integrated assembler). But there is no way to express AS_IS_IAS today in KConfig (similar to CC_IS_{GCC|CLANG} or LD_IS_LLD). I don't think that's necessary; whether or not clang's integrated assembler is used, when using clang, run the simple check. > > --- /dev/null > > +++ b/scripts/test_dwarf5_support.sh > > @@ -0,0 +1,8 @@ > > +#!/bin/sh > > +# SPDX-License-Identifier: GPL-2.0 > > + > > +# Test that the assembler doesn't need -Wa,-gdwarf-5 when presented with DWARF > > +# v5 input, such as `.file 0` and `md5 0x00`. Should be fixed in GNU binutils > > +# 2.35.2. https://sourceware.org/bugzilla/show_bug.cgi?id=25611 > > > I saw the following links in v6. > > https://sourceware.org/bugzilla/show_bug.cgi?id=25612 > https://sourceware.org/bugzilla/show_bug.cgi?id=25614 > > They were dropped in v7. Why? > > I just thought they were good to know... While having fixes for those bugs is required, technically https://sourceware.org/bugzilla/show_bug.cgi?id=25611 is the latest bug which was fixed. Testing for a fix of https://sourceware.org/bugzilla/show_bug.cgi?id=25611 implies that fixes for 25612 and 25614 exist due to the order they were fixed in GAS. Technically, you could argue that this script is quite GAS centric; given an arbitrary "assembler" the test should check a few things. Realistically, I think that's overkill based on what assemblers are in use today; we can always grow the script should we identify other tests additional assemblers may need to pass, but until then, I suspect YAGNI. Maybe there's a more precise name for the script to reflect that, but that gets close to "what color shall we paint the bikeshed?" Given the number of folks on the thread, plz no. -- Thanks, ~Nick Desaulniers