Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3134745pxx; Mon, 2 Nov 2020 00:22:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5nxFQPe5hkBdtzaa3IxCOblosbeR0q/ANGzrg75YJ4IpPeXLYdje/SRIm+VbrurvFRTeF X-Received: by 2002:a17:907:7244:: with SMTP id ds4mr14148907ejc.172.1604305346969; Mon, 02 Nov 2020 00:22:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604305346; cv=none; d=google.com; s=arc-20160816; b=p7zLyfM7SJmPf7rrRBTlaeGOr/Fn0BXHZ7ih6VENuazuPfiHUHwem2+Y014lqu1mbO fv/ehKIzj6pRyh2jQJRuFC/6lpZqtG6sicaq+82s50rHMW966lzz7MACJdplf+JIG+hO qUobgHHIcoYuZ3aBafF9fyEltWbSm9Z3cClnSfirNZd7naJYLELBSP4Ny7OQ3wvlOJ1+ ObEpDrhwBzq6Se0Ct6bKf2MxRNHvMBTQIdyZcOgmReUkTXNTnvxCfR6hyB5e8fKdxZT0 RyBfG3Ua8ahkcQIylCu2BKXbcsEs63ZjrDwL2pAQY+/4GcmWbeY8vjdsCXiUg44QEbIB zRyA== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=p2/Gm5Zzs68XWZ1TIg04nCFfNOqnMxjP5SvlL/3RU60=; b=h1nAILkI+b+uNIfjxBappFMilfsRoUMi9lNODr/GvUdrGDHk7gMdtAvm1qJKby8N6G n7tyxXw9yNuvhR+q+D4JPlFjQzL0sVWn4s0FqBTtzzefbUjTfXo2k6By+WJEgBVKAsMW PAph5jOMg1P74aRUjZNIGldz3gps7ozC2XQiMt9JJVpPqL6qXSfqYrY40SDZ+yrgG4dy +3aMDleFnf6GGpbJHOG2x3JIb5p904tR+7j4Kpf3aDWAvecGMHd89N5Uknpv+LxtU0qe 7USOR2ZxNZW7EC0YjbMcX1EQnNZZ4HPjZqOf5MrgJJhbk3M7p65n0obcxkASFQ1F2c/6 iI/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bqzLN3q6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oi22si11571502ejb.754.2020.11.02.00.22.04; Mon, 02 Nov 2020 00:22:26 -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=@redhat.com header.s=mimecast20190719 header.b=bqzLN3q6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727992AbgKBISU (ORCPT + 99 others); Mon, 2 Nov 2020 03:18:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33130 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbgKBIST (ORCPT ); Mon, 2 Nov 2020 03:18:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604305099; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=p2/Gm5Zzs68XWZ1TIg04nCFfNOqnMxjP5SvlL/3RU60=; b=bqzLN3q66/8JrloIWMzlftBWR7fEfKVdNFHKTy/23DUJlnajD2mR6W5FIruNWyrKqB8nfW 196fwyzgHI8uiOC1/TfDqCQ83WDMwSkuaey4HJGmSOLjVw+EHNjmZjvHyeqxNMmC69oFSf y/6op7voUGFBBD23oH8xWpQePm8myPY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-425-l823rQMPM8OOJ7PVoyo1Jw-1; Mon, 02 Nov 2020 03:18:16 -0500 X-MC-Unique: l823rQMPM8OOJ7PVoyo1Jw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A2AD6D581; Mon, 2 Nov 2020 08:18:15 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-127.ams2.redhat.com [10.36.113.127]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE8C619C78; Mon, 2 Nov 2020 08:18:14 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 0A28IBmo2320689 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 2 Nov 2020 09:18:11 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 0A28IAlA2320688; Mon, 2 Nov 2020 09:18:10 +0100 Date: Mon, 2 Nov 2020 09:18:10 +0100 From: Jakub Jelinek To: Masahiro Yamada Cc: Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , linux-toolchains@vger.kernel.org Subject: Re: [PATCH] Kbuild: implement support for DWARF5 Message-ID: <20201102081810.GB3788@tucnak> Reply-To: Jakub Jelinek References: <20201022012106.1875129-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. The reason is to get DWARF5 .debug_line (.debug_line is usually produced by the assembler, not compiler, from .file/.loc directives). Jakub