Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp851051pxb; Tue, 3 Nov 2020 14:24:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+Cyob4efdjEck1UhJXmgpRZjZhzdrULCy4MXB01GGRFeY1N41kWGZE5uia8G1pzRDaaJ1 X-Received: by 2002:a17:906:1d50:: with SMTP id o16mr17773785ejh.145.1604442258066; Tue, 03 Nov 2020 14:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604442258; cv=none; d=google.com; s=arc-20160816; b=y6CMw/TFzQ5KYl5g56YL0xQgqwnZTxkeu3ZfRFUHBBFGDwFLhujIe5P5LiqOkNlqY0 tfNPLr8QdEis5Wm7DCA+AMk3hmvZxhYm/HaScmk4YeCq1smVMbA9hYIhAGkcq1CW8l6S hCVSOlW9Mfk4eG+ptwRC1lBWibZ5Ar9/2fFGtAilS/uxI3aDkZmcadk0J8NSYzpdIKru zRNCrUR3wT3Gvs9U8cBc8UBo5XzR5/komYRfjjYXCJDdnL6GqyNbMVDnekLodALukplt x2igkvZ7w6fqkgKASM0lDR3fSwO+Ms5HgNAG0FJQKF6Kukrq7EzBlAZAH6O6cDCnWjcg BcAQ== 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=t/8gNKrqVbgeWIKJqFS6oCAzempsVueUa9v+XEgt+p4=; b=PyeOw5qy/1dHaHvq686HO9RBvTTnoNU1i/1zWDmdZPtRwdLPjjjObtfQ4xECjHO8lD y8tiaSxYRQqp03ph1wnA75K6TNo2l8g1I8eHHMeGNaTNpP6ci3zVZi1FEeqe9w0qNK3+ sGLnLLXpLzyybak4Uu8jShmuV5DwRHvl1aIwuYbBNyGFH4X3QsmgF0QhlO/J1wIb0Cgy lJy+QomRJ9uTHujyaZhp2ws8leZjUjiO1rYv4otBEb5Z5Xu2NTzOJPWnYAGfPQILoK2Y BeS8UeIKXJI//rSN0wtPpLBB/J0oOUPVlLqUgB+sXO9EuYGpLhVQEQwZa1F4zdQvvf0J m55w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=csXlt7v0; 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 i13si151396ejf.392.2020.11.03.14.23.55; Tue, 03 Nov 2020 14:24:18 -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=csXlt7v0; 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 S1730277AbgKCWVf (ORCPT + 99 others); Tue, 3 Nov 2020 17:21:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730264AbgKCWVe (ORCPT ); Tue, 3 Nov 2020 17:21:34 -0500 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A147C061A04 for ; Tue, 3 Nov 2020 14:21:34 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id 10so15564669pfp.5 for ; Tue, 03 Nov 2020 14:21:34 -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=t/8gNKrqVbgeWIKJqFS6oCAzempsVueUa9v+XEgt+p4=; b=csXlt7v0/moo9v9ILRwAZYxMof8y+D7baLlBSkK8Jlm/0wJFuTqmB+9NxNWDoE6sJ2 yjtUqFnz1TmMTPiOg9/+a9VOS3+9XslH30wI2lAgW8gzYPZdZr7cFFaMaXudtzRiHcnQ dFMQywooaQM8HFoZ5S3igHBkVvbAnQrH3GeS66/OwLyHMXfNsDeCLD1hrhFdm1+UD/w/ LlIsLuf/9iMgGqpLiZd3mDGwJ3l93NYpBLm4GLAiG8anGeoh6o2+9nEpxeBl4qfsD/qL 8u7cxodm26r3wp/jBnzR5rgm9l6+mUU20Vy2JIZs83UfAc/DxXj3QnXNCbQ9JZGafuff m5KQ== 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=t/8gNKrqVbgeWIKJqFS6oCAzempsVueUa9v+XEgt+p4=; b=QBs4/kpi23amBXOMUnQ615LwEfaZBmo6Z+Ny7E8XCuuLAe0a1zn+dwQwOlpxoMKIMa +DnFClwDuTmSNlYHnVUqdtvSjEMUdEBdgw25OeXdfjbv7u8ToL4eOhJhzgmoQLHMpOqn nctcDLWQJm/8s1vm0x3NVPkIuXNfyNQnNc9ZG8K4vcAGMyq8+x9RlsJZ9ie6W7STcky3 hiJYHcIByG6X3uhEHHI1GubQrsxflwixYY8MDRFxKhBCzu4aCIx7II2L6Cc9fqimtuiA bP13DR3cKP5czMSg4SjZWu36Jaa97OO5xEF7pBSNsq5T6QHqUFnNHt4pq+qL8YRh+pyN PeVQ== X-Gm-Message-State: AOAM531U3RAiUJirdjioYwGE1yMGKQjgVVPgiKrzBRDJ5uH17g065icA dF6p0cHkmHsSmlgl/2uiTetIqvCb/RUsWQpm+4hJJQ== X-Received: by 2002:a17:90b:110b:: with SMTP id gi11mr1311215pjb.25.1604442093720; Tue, 03 Nov 2020 14:21:33 -0800 (PST) MIME-Version: 1.0 References: <20201022012106.1875129-1-ndesaulniers@google.com> <20201102081810.GB3788@tucnak> In-Reply-To: <20201102081810.GB3788@tucnak> From: Nick Desaulniers Date: Tue, 3 Nov 2020 14:21:22 -0800 Message-ID: Subject: Re: [PATCH] Kbuild: implement support for DWARF5 To: Jakub Jelinek Cc: Masahiro Yamada , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , linux-toolchains@vger.kernel.org, Alistair Delva , Nick Clifton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 2, 2020 at 12:18 AM Jakub Jelinek wrote: > > On Mon, Nov 02, 2020 at 11:20:41AM +0900, Masahiro Yamada wrote: > > > --- /dev/null > > > +++ b/scripts/test_dwarf5_support.sh > > > @@ -0,0 +1,4 @@ > > > +#!/bin/sh > > > +# SPDX-License-Identifier: GPL-2.0 > > > +set -eu > > > +echo ".file 0 \"asdf\"" | $* -Wa,-gdwarf-5 -c -x assembler -o /dev/null - > > > > > > > > Please tell me how this script detects the dwarf-5 capability. > > > > > > This script fails for GCC 10. > > One thing is GCC DWARF-5 support, that is whether the compiler > will support -gdwarf-5 flag, and that support should be there from > GCC 7 onwards. I should improve my Kconfig check; I don't actually have a test for -gdwarf-5 for the compiler. In godbolt, it looks like -gdwarf-5 produces an error from GCC up until GCC 5.1. Does (5.1 < GCC < 7) not produce DWARF5? Maybe there's a more specific test you had in mind? > > Another separate thing is whether the assembler does support > the -gdwarf-5 option (i.e. if you can compile assembler files > with -Wa,-gdwarf-5) for GNU as I think that is binutils 35.1, > i.e. very new); but only if you want to pass the -Wa,-gdwarf-5 > only when compiling *.s and *.S files. That option is about whether > the assembler will emit DWARF5 or DWARF2 .debug_line. > It is fine to compile C sources with -gdwarf-5 and use DWARF2 > .debug_line for assembler files if as doesn't support it. > > Yet another thing is if you can pass -Wa,-gdwarf-5 even when > compiling C files. There are several bugs in that category that have been > fixed only in the last few days on binutils trunk, I'd suggest > just not to bother, GCC 11 will have proper test for fixed assembler > and will pass -gdwarf-5 to as when compiling even C sources with -gdwarf-5. Do you have links? I would prefer to do feature detection rather than version detection when possible. If the bug is so severe that we think we should scuttle support for old versions, I'm ok with that, but I want to be able to link to hard proof in a commit message so that in 6 months when I forget why we made a certain decision, we have historical record in the commit message/git blame. -- Thanks, ~Nick Desaulniers