Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp300238pxu; Fri, 11 Dec 2020 02:39:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDCZ4KEGWpyhDhUrVAwzbzv4xYN8L5TcI101lKqduPADvCk2612dHU9L+C+/1TjSJdz1qO X-Received: by 2002:a17:906:d93c:: with SMTP id rn28mr10245162ejb.50.1607683161349; Fri, 11 Dec 2020 02:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607683161; cv=none; d=google.com; s=arc-20160816; b=yWiIhZjzqvwfh5KXrpDozQ9pUw8nWA8X1CcObQICCtFzJo08ZtA27QSTdaKLmIVu1f N2/O2Y+tsUAosPwGtkzwxzKAw+tSA5Gfu/IZYFRuRHcQFzO4cDeOwjka+ZYgOF21UWNk B/T4y8mtO1F7GcecvL0AT9EcBS46er7quMjLW4YbOsPvMgTx+6Fw81sNDd/shK0GnNsN hmh0SAoBmukZlWLv1PLjYLUtj5bBkCVnpELOGTsH4j/G0vBUE7ocH9Wnkm4NN7Au8GJG BOwlhqnbzQuokFrCx6iwMvL42zC+agT1so+3RYi7b4biQh481xzvqjy50J9yMOyVqaFc 2ybA== 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:date:from:sender:dkim-signature; bh=Rmf7XBQbFrTt9I7PMZkiNuKnWeN4JeUQNc3H8Tyzf/U=; b=R0lgDQSpDQM1rpGY+R90qlTgaOwRQEPcbz15ArREwWcyT4+CrLacftItEEZotX76xb OXSRsxw7J2wzT9azQURplckErekVsSFfeR/LzHsAzlW5yY0dfIQwgGrF//kost+T/G5Z URTqVZK9WmohoaR0aGCrL40uwP9WS8fA8f6Bc9Q2YvE+Bd72YnN1XxH1lz4lb+XeMry0 /8NhBbtCRLm9Ymi3i0omMftxpx9IUUYRshNa5AfYEqwynIH1I6mwWZIW+CFRgUH8M3Yb geY8ruAN+AbU3ZkBX5OHvmrf9t89r1L8XEBPI2QZPIvaUJQfjc2lxr4Ve/fOXeK4vCez xMUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JS2eCDhe; 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 s9si4577710edt.290.2020.12.11.02.38.58; Fri, 11 Dec 2020 02:39:21 -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=@gmail.com header.s=20161025 header.b=JS2eCDhe; 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 S2404180AbgLKAaR (ORCPT + 99 others); Thu, 10 Dec 2020 19:30:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730504AbgLKAaG (ORCPT ); Thu, 10 Dec 2020 19:30:06 -0500 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349A0C0613CF; Thu, 10 Dec 2020 16:29:14 -0800 (PST) Received: by mail-qt1-x841.google.com with SMTP id b9so5288183qtr.2; Thu, 10 Dec 2020 16:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Rmf7XBQbFrTt9I7PMZkiNuKnWeN4JeUQNc3H8Tyzf/U=; b=JS2eCDheJmAIEiKWoMPrlBYMlF4uI6GfILrKJhp5qEkVz7WR8fk9fDCcD66wJbwEho dSn8vCEzr59Ks/qKJZrMsYK38ZLe8wLeP5+PtzuBKPZ5YQCc35ZoIpDvX5xx38wx4CJw LvGc8ovG1GDmjthfRFCavlMMbxE/Wm3Etx6N/nYgmW9JEaPC6Lm6pcBcCjWIPpPqVFZx pX/DZQf3NuIbGRzTrC9G5gM3qPBGwaDzCMwQwwt6J3/0Bj7IaQ1lRNbndxpqm95j2hQH DZEJFFormfcKujczKC4B/0J5krQmSULUMHAeE6NJooB5ApUdgU6ZEHg18JNt6hOF1mXu tJTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=Rmf7XBQbFrTt9I7PMZkiNuKnWeN4JeUQNc3H8Tyzf/U=; b=XOybh65Wb3C2ybWIcTWvkLUs+gAM0tOPbp/pdz8oNlrSgiYBR34zHD80/fouAmQrLv CMLNN75Nc9KaJ4OzznotzJ12+KyvOp9aAYMEPr5/+5YhtMUWwJRXUOAb2WE9wvQiB0hS aT4QZkUrIOxwN699TZRNezM4DrnPZIpTylGPcvG1HuwinWTfmsia5CZ3GDwEbSMX9eyf S6bxGhCmKwfRqFI3J/KPt32mr0P1ItN6D1F15SblKlog+kD/c64r4JJDaEMqM+YboSnU 8sR40dmd+hPppUmXsE+Tg6kZod+AfCHyy0inxR8Bv0WOilNPOlBSC3UXPjLUKT2T+HNE Pwbw== X-Gm-Message-State: AOAM530IKRq5eFA4buM8l6eUPsNBXKKnNyAjvS0RumS3VlMI2lKl/iBW F98FdEOB0CnTdDw/dwjWuzo= X-Received: by 2002:aed:3025:: with SMTP id 34mr12349937qte.39.1607646553220; Thu, 10 Dec 2020 16:29:13 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id 187sm5646082qki.38.2020.12.10.16.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 16:29:12 -0800 (PST) Sender: Arvind Sankar From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Thu, 10 Dec 2020 19:29:10 -0500 To: Nick Desaulniers Cc: Arvind Sankar , Masahiro Yamada , 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 Subject: Re: [PATCH v2 4/4] Kbuild: implement support for DWARF v5 Message-ID: References: <20201104005343.4192504-1-ndesaulniers@google.com> <20201104005343.4192504-5-ndesaulniers@google.com> <20201124172836.GA346213@rani.riverdale.lan> 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 Thu, Dec 10, 2020 at 03:18:45PM -0800, Nick Desaulniers wrote: > On Fri, Dec 4, 2020 at 9:06 AM Arvind Sankar wrote: > > > > Why? Does this actually cause any problems? > > > > It seems like the options for gcc can actually be very straightforward: > > you just need a cc-option check, and then add -gdwarf-N to both CFLAGS > > and AFLAGS and you're done. Adding the -Wa flag is superfluous and > > carries the risk of interfering with what the compiler driver does. Just > > let the gcc driver handle the details. > > > > Clang/IAS is almost as straightforward, with the only additional edge > > case being that for assembler files, DWARF 2 doesn't work, so the CFLAGS > > is the same -gdwarf-N, but AFLAGS gets -gdwarf-N only if N > 2. > > > > The messy case is only Clang/IAS=0, which needs to check the support > > from the external assembler, and needs CFLAGS of -gdwarf-N and AFLAGS of > > -Wa,--gdwarf-N, because Clang doesn't pass that option on to an external > > assembler. This is why I was asking if the assembler support check can > > be restricted to CC_IS_CLANG: nothing but Clang/IAS=0 actually requires > > that check. > > Oh, I see. Yeah, that might be a nicer approach. What should we do in > the case of gcc < 7 though, where -gdwarf-5 won't produce DWARF v5? > Maybe that's ok, but the intent behind the Kconfig check was to > prevent the option from being selectable if the tools do not support > it. Maybe it's more flexible to pass the arguments along, and hope > for the best? > > As a gcc-5 user, I might be surprised if I chose > CONFIG_DEBUG_INFO_DWARF5 if what I got was not actually DWARF v5; it > does violate the principle of least surprise. Maybe that doesn't > matter though? Even the current gcc documentation still says "DWARF Version 5 is only experimental". If the user wants to try it out, I think it's fine to let them get whatever subset their tool chain produces, as long as it's not completely broken. Your latest help text does say that gcc 7+ is required, maybe add another sentence saying that gcc 5+ only has partial support for some draft DWARF 5 features? Thanks.