Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp295781pxb; Wed, 4 Nov 2020 23:29:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2ATlP3FGA16blVi+2E1i/kvTP82VXux22WDXq2jc001KIhHw0EzuMLD7on9GYyJB4sYpA X-Received: by 2002:a17:906:6a94:: with SMTP id p20mr956834ejr.499.1604561365744; Wed, 04 Nov 2020 23:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604561365; cv=none; d=google.com; s=arc-20160816; b=PqYgOI/grXVIXlkb+5en1kTnGTbWvoJILgwy0sddXhKiSZhJ7jcgvfJMtaccGlnPzx J/6Mboi4IGFBCSKydqHjNaa3ZxW+v6e8B2yTE7PvwGKml22x1QD9oEVszrYxzS1G4z5b zgF52zRJSio1Y0ujyFMOlqw9+J0KIPgN9LoDJPMkypcG0ufvKT9w0IuqujVlqYF6q8/W D1Fd2yQuHIbjSoflu+eVvZtmUA51lzZAkIbV+Yj2l5w7RHCztMaUG3vd4rTXrDrF5id/ 6GbmrBmxybX4JL9xa+VaczSBKet8al0lyA3nVfZRQW9vZ7owkrp4jYa/kefGmOfjosFx TNsw== 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:from:date:dkim-signature; bh=V0nJfAeq3JFSY5yN0H+uBOSwyjDPQ9GUT0hanP1k660=; b=AdaoBthcB7EmU0+3Iahiel4fmmq505cS6xymfVxK2hX1UbyN8PwHYT9a9tfa1VONox G+Q9WRKf2oT0aeI9VZvk4sEg9cWuWeY4K2IyfR/rOe9oaZHk49mqJBpm8HYFMLcN4HO7 N9os5A5SihGSaEmHttKKt+e9z8sQ0n6uT43rktpX4YfVXSedjB+q8uZD1lT4n5hyz9sd wh3cwR2c5XjQeUI5w/E0tWC7g5yfK+I86JJ0XYSzxyuusuNd5GbJTVH3ChnWBJ7tM3BA paKa0MrQ7YJkFbFdvt04Yg1zzOnJDBLdesyblI92Xd7uD8BP//hFLOSwmh0BD65bzqlK faAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RuVHQPKx; 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 c21si528568ejr.483.2020.11.04.23.29.03; Wed, 04 Nov 2020 23:29:25 -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=RuVHQPKx; 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 S1730126AbgKEH1A (ORCPT + 99 others); Thu, 5 Nov 2020 02:27:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730124AbgKEH06 (ORCPT ); Thu, 5 Nov 2020 02:26:58 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F1E5C0613CF for ; Wed, 4 Nov 2020 23:26:58 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id x13so727034pfa.9 for ; Wed, 04 Nov 2020 23:26:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V0nJfAeq3JFSY5yN0H+uBOSwyjDPQ9GUT0hanP1k660=; b=RuVHQPKxtxfoOThH7XJOEGi1n7OVLxAPwQYgZRxGhPQgxOnXmn1dIAteRQtMOQkLLn XZqPtUxh2to3RTU3k942+Al6R3nEwBf6t3sOBz9jdoXjI/+6JH/MrDEYXAPDRuY+SqPT wfPKsy2RwFFR6P4RpzhBg9gAj5KxGHpOghashFYJPLnU8aq4oaldLoCkPfx9wL9EH0eI JkG++ejRWc6PNDyhBd6aQzOGAJtZzIyPfMBs1Z8sJUhK0LL3uZntt7pwdPTqyPxWogx3 wPY9djxtgRhVoUuPKMLJFVhF8u+imdmRU2S6qzfla+OlMI7TCoVQhwkh2/ev+4ogkAz1 Ny8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=V0nJfAeq3JFSY5yN0H+uBOSwyjDPQ9GUT0hanP1k660=; b=fwf+1JyAoTyelgG/lospS5DjP/1pOUqmJIVSWyHd6a08F5hXpy8Q7h4CTXTUFLm2ut i+RseModRXlpzK053diqsth0lrtxlBlfeEySm341mWFJoI9GtDE5JKpfx2oAydOv2nBG B/xHnozsq4bugNsoAiy9W/k8YW9KQDCz8B72UJ+Tgq220JKB678dMNVxl3XFTXCa+iXt jQAdTECpPYNWpg92vrqVS3N3L2ThKQ9WJqhZLn2VZgfHjWcJFydFU1iKe2+xLRe5yQZL lOEGWf6jhl0d9Qvc9HU/+0rcOyv664tlRk3nEtESpDMBpjbVTYEb4XHy5/Ne6ZRLFbx5 aP0A== X-Gm-Message-State: AOAM531wOgIJda4elH3YNENnYKKCtExMyDRA5WRp+f9fYD2K0qhpwKLN wtBza8RBgEE8tT/pA7nCIzUEWg== X-Received: by 2002:a63:f445:: with SMTP id p5mr1200747pgk.293.1604561217561; Wed, 04 Nov 2020 23:26:57 -0800 (PST) Received: from google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) by smtp.gmail.com with ESMTPSA id j11sm1203750pfh.143.2020.11.04.23.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 23:26:56 -0800 (PST) Date: Wed, 4 Nov 2020 23:26:53 -0800 From: Fangrui Song To: Nathan Chancellor Cc: Nick Desaulniers , Masahiro Yamada , Jakub Jelinek , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-toolchains@vger.kernel.org, clang-built-linux , Sedat Dilek , Dmitry Golovin , Alistair Delva , stable@vger.kernel.org Subject: Re: [PATCH v2 2/4] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Message-ID: <20201105072653.wxlzat5azj7h4ttj@google.com> References: <20201104005343.4192504-1-ndesaulniers@google.com> <20201104005343.4192504-3-ndesaulniers@google.com> <20201105065844.GA3243074@ubuntu-m3-large-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201105065844.GA3243074@ubuntu-m3-large-x86> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-11-04, Nathan Chancellor wrote: >On Tue, Nov 03, 2020 at 04:53:41PM -0800, Nick Desaulniers wrote: >> Clang's integrated assembler produces the warning for assembly files: >> >> warning: DWARF2 only supports one section per compilation unit >> >> If -Wa,-gdwarf-* is unspecified, then debug info is not emitted. This > >Is this something that should be called out somewhere? If I understand >this correctly, LLVM_IAS=1 + CONFIG_DEBUG_INFO=y won't work? Maybe this >should be handled in Kconfig? > >> will be re-enabled for new DWARF versions in a follow up patch. >> >> Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with >> LLVM=1 LLVM_IAS=1 for x86_64 and arm64. >> >> Cc: >> Link: https://github.com/ClangBuiltLinux/linux/issues/716 >> Reported-by: Nathan Chancellor >> Suggested-by: Dmitry Golovin > >If you happen to respin, Dmitry deserves a Reported-by tag too :) > >> Suggested-by: Sedat Dilek >> Signed-off-by: Nick Desaulniers > >Regardless of the other two comments, this is fine as is as a fix for >stable to unblock Android + CrOS since we have been running something >similar to it in CI: > >Reviewed-by: Nathan Chancellor > >> --- >> Makefile | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/Makefile b/Makefile >> index f353886dbf44..75b1a3dcbf30 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -826,7 +826,9 @@ else >> DEBUG_CFLAGS += -g >> endif >> >> +ifndef LLVM_IAS > >Nit: this should probably match the existing LLVM_IAS check > >ifneq ($(LLVM_IAS),1) > >> KBUILD_AFLAGS += -Wa,-gdwarf-2 >> +endif >> >> ifdef CONFIG_DEBUG_INFO_DWARF4 >> DEBUG_CFLAGS += -gdwarf-4 >> -- >> 2.29.1.341.ge80a0c044ae-goog >> The root cause is that DWARF v2 has no DW_AT_ranges, so it cannot represent non-contiguous address ranges. It seems that GNU as -gdwarf-3 emits DW_AT_ranges as well and emits an entry for a non-executable section. In any case, the option is of very low value, at least for LLVM. Reviewed-by: Fangrui Song