Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2097857pxb; Fri, 29 Jan 2021 13:09:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxYw48wA9ZkrwqoTX0BSNbD8kqx0UV41VR+h57NPXEsDGJ2F4njY7oVH4z9IPCAFE1e82W X-Received: by 2002:a05:6402:1152:: with SMTP id g18mr7488917edw.18.1611954560021; Fri, 29 Jan 2021 13:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611954560; cv=none; d=google.com; s=arc-20160816; b=qs9jvtz/6GSOj5t73q9zT9Eeu6CBhYpbImBDHOwIcL5HlgxI1Zv7x5BDkPxMC2pWR+ kTE44DvV+riY2CIeOzpw4OF+BrmzVfUAWIjhgjqOMrQDMTPas1IUI4zuplZLwlPgEBMS BjGISeHQVe6K9FXdfWfdHPQQHtfAYA3+116etk2vPfx/YBqwaJVMLTtT3RegR2rTv4d4 H4KVBh30wrihpOqJnJa+sCpFJwrKMRtWOYvhiJaH38/szR1o/mTDasFY3lcS8t3SXme2 Mlb4OyQiirg2kNQGgQTQSAHtqFUTC99YdywPVN+dWZEEJIEF6BuunSxFYFXLRgH50x9n uLbA== 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=tnOtPGCrnLbOPAzZu8d1fRX/n06p6RDZZdjSy9Y6a3A=; b=ZxzEGd2ayoGP8Kr7nviHuTBE/vhbrgIwDT7JEia0GgYA+Bt0F9D9OIcI5v7jKB71+F ELAExRdPgUntV6EUbiQAvRhO5QLZHb9gPFwUi0oCWtnymNhOc5EMIkRoKdMXjzt5aIZb tx+kW2myDkVm6VNRatC2l8Ef23LqCnZve0B6su7uJP/OinKTbxaIV3tiyVQbPbcd9/xP ADmN1iT46PxFPkUz7eDmRE5Qk2ICD56Gh9hshYnVaPA8xoIoUCgpYRt41rXSTfERssDH 6FzoYt4YzvSkiJ8NQo+YC6Nh+FpDoXAH43+tKaOeER7pTS5w5z4mzXv+U7VWWWt3SxsJ PpzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="OB/msvX2"; 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 e22si6321878edu.9.2021.01.29.13.08.55; Fri, 29 Jan 2021 13:09:20 -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="OB/msvX2"; 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 S233281AbhA2VGu (ORCPT + 99 others); Fri, 29 Jan 2021 16:06:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232776AbhA2VGr (ORCPT ); Fri, 29 Jan 2021 16:06:47 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDC7DC061756 for ; Fri, 29 Jan 2021 13:06:07 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id t25so7506654pga.2 for ; Fri, 29 Jan 2021 13:06:07 -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=tnOtPGCrnLbOPAzZu8d1fRX/n06p6RDZZdjSy9Y6a3A=; b=OB/msvX2vSHixwSy0vhw9dmLvr1kLoG2MammDQhMcQt4kaemfXLZbve53KZO/uuvm6 PulOWwEjZ/e/c6MA0CSewMDyrY0y0bONOIO+9nM/1XDuQevzaawvU67RWTadKGmeQCa6 gpG18Y6dSJcD1tEFs/iVRF7oc8FagqzgLPbb4YTGZ7ZAa3j+LqRcTW5mDfBxRhIGFUxE GaUl0B1amcvckuKh6rVTYp1MlQs74t3hmS2xPywpQvOlMdBY9Ww43qQbMnC1+hAGIZLZ pT1BVNdWmi+qqUR7Itpo9u9lfNHF84EHTJ8K+t/EfAZFGkOghtybN9i3aubx804wBGt3 IM1A== 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=tnOtPGCrnLbOPAzZu8d1fRX/n06p6RDZZdjSy9Y6a3A=; b=eoS7072MSZNfum6lCbGENU1VjGxOn/5YX/z4viipn4K2BYeTcfsXIcdEug3vapiPFg a0rL+k5f/E3w3amtwRH2DZBtS2Z0wbNAyO6fQoZ91XxcWXhNzp7ng1SDrWZ+bHAFfkzk 4dFUjXpLWFgI3MzMWUyBn55YP35I/Z8unmnjdjv1om8w4pyiYmtEJRnydLSNTjz0fsHF QQzRXQMIddkVisLHVB2c3OazM2kJsXM4yyq2qLCRiiRpg869NGvY7LKbU1mXALcts+RU IX1mPHSwAYheIzoBFfPTnMZ5YS698YYiSZTeE4bK6mc9o+4YzrGKWOQCrPQ/HJrPPiEM stJw== X-Gm-Message-State: AOAM531dsRduH3kCxEtmLLnyoykH3rGtQvHOfmG59ocBCuK7Yg71dCHh TT0uATYBScQU7BCDYlWtKk5F22sn7643fnfpHK2mkQ== X-Received: by 2002:a62:1896:0:b029:197:491c:be38 with SMTP id 144-20020a6218960000b0290197491cbe38mr6189245pfy.15.1611954367137; Fri, 29 Jan 2021 13:06:07 -0800 (PST) MIME-Version: 1.0 References: <20210129194318.2125748-1-ndesaulniers@google.com> <20210129194318.2125748-3-ndesaulniers@google.com> <20210129205702.GS4020736@tucnak> In-Reply-To: <20210129205702.GS4020736@tucnak> From: Nick Desaulniers Date: Fri, 29 Jan 2021 13:05:56 -0800 Message-ID: Subject: Re: [PATCH v6 2/2] Kbuild: implement support for DWARF v5 To: Jakub Jelinek , Nick Clifton Cc: Sedat Dilek , Masahiro Yamada , Nathan Chancellor , Andrew Morton , LKML , Clang-Built-Linux ML , Linux Kbuild mailing list , linux-arch , 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 Fri, Jan 29, 2021 at 12:57 PM Jakub Jelinek wrote: > > On Fri, Jan 29, 2021 at 12:48:11PM -0800, Nick Desaulniers wrote: > > > Should this be...? > > > > > > KBUILD_AFLAGS += -Wa,-gdwarf-5 > > > > No; under the set of conditions Clang is compiling .c to .S with DWARF > > v5 assembler directives. GAS will choke unless told -gdwarf-5 via > > -Wa,-gdwarf-5 for .c source files, hence it is a C flag, not an A > > Wasn't that fixed in GAS? > https://sourceware.org/bugzilla/show_bug.cgi?id=27195 ``` diff --git a/Makefile b/Makefile index bed8b3b180b8..de616e584706 100644 --- a/Makefile +++ b/Makefile @@ -835,17 +835,6 @@ dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) := 5 DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) -# If using clang without the integrated assembler, we need to explicitly tell -# GAS that we will be feeding it DWARF v5 assembler directives. Kconfig should -# detect whether the version of GAS supports DWARF v5. -ifdef CONFIG_CC_IS_CLANG -ifneq ($(LLVM_IAS),1) -ifeq ($(dwarf-version-y),5) -DEBUG_CFLAGS += -Wa,-gdwarf-5 -endif -endif -endif - ifdef CONFIG_DEBUG_INFO_REDUCED DEBUG_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \ $(call cc-option,-fno-var-tracking) ``` $ make LLVM=1 -j72 defconfig $ ./scripts/config -e DEBUG_INFO -e DEBUG_INFO_DWARF5 $ make LLVM=1 -j72 ... /tmp/init-d50d89.s: Assembler messages: /tmp/init-d50d89.s:10: Error: file number less than one /tmp/init-d50d89.s:11: Error: junk at end of line, first unrecognized character is `m' which is https://sourceware.org/bugzilla/show_bug.cgi?id=25611. $ as --version | head -n1 GNU assembler (GNU Binutils for Debian) 2.35.1 Maybe GAS should not need to be told -gdwarf-5 to parse these? Then we would not need to pass -Wa,-gdwarf-5 via clang with -no-integrated-as. -- Thanks, ~Nick Desaulniers