Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1956370rwb; Sun, 2 Oct 2022 11:24:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kl/DukjwKDedgof66H0kO1NBxP6/6hwHTdhaYJA1wPOOLIbBiZU0fkJIoNB9pM5+Hw+Ud X-Received: by 2002:a17:906:eec1:b0:782:6384:76be with SMTP id wu1-20020a170906eec100b00782638476bemr13032878ejb.756.1664735051924; Sun, 02 Oct 2022 11:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664735051; cv=none; d=google.com; s=arc-20160816; b=jMzu2Pd1tx7GzYcLBPfr2FgayBVo0U4Nzhm+5GrmPUT11eZZY34Ia/t0CGg4FEHiXf LePDigffPV+Btiu5vIBwyS1S3yqjggiC9gSqmAo1fsSbgsYrGrS2S/oMDZI0f0fuh5yP YPZTK5FF/1BV/RumDN75j6ura2zFJvImj0hQ7GXvzezyIww1z8ZZmZKBRhaHGoTl7WxS t7ss+KRKqeaivP3sXJkEAEVe1RoY4/QAiNSL6vmAgzrH/gUuilfgMHmmKz9BDnSD2Bdy RBeulF1hUhePenyumrHTwAhmZI3kx5UjOnsqx+S+/NTdWeKRpC5tZeR70nUqG86a/Ejq YNnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=R4t/6fMIwaYlwYPM6wHfjnpUbzkfUGo1Wg0yhRD/I3I=; b=ds2+ufoxupR4jTuJKlO4AAZWJPj4dg8hlaaDX2fqC0nHZ8+ZZxEz/lKxZqepmfxDRq Pza489dSwk7gOtpRNK+IvDEtpq069bFN0bxA7EwURKwDOSzzljAEwAPJVd3Nw7Ocyldd b/MUOfb+NstzPVN/Qupyk+QPG0SD2MiQWPp4mszQHxZM4DPdALvVTlaMTqg7+kYmzUqV X2A3AXB/ct2aSnf91wndzP5BGtjJn1L7YgxNEx8pwZEw3l95PnKzPKuKTmEIIJc6Qsxx plgIJnOXnEnzWMMyITV+TIh4JeKoHOgJuiD4XVHtQurrEmmSX8TXL6nIpJxuwfCzeR9g g7fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RtDj4kjX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc19-20020a170907169300b00774195db4e7si6971079ejc.117.2022.10.02.11.23.41; Sun, 02 Oct 2022 11:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RtDj4kjX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230021AbiJBSMf (ORCPT + 99 others); Sun, 2 Oct 2022 14:12:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbiJBSM2 (ORCPT ); Sun, 2 Oct 2022 14:12:28 -0400 Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F4334986; Sun, 2 Oct 2022 11:12:26 -0700 (PDT) Received: from zoe.. (133-32-182-133.west.xps.vectant.ne.jp [133.32.182.133]) (authenticated) by conuserg-10.nifty.com with ESMTP id 292IBAaD004037; Mon, 3 Oct 2022 03:11:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 292IBAaD004037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1664734272; bh=R4t/6fMIwaYlwYPM6wHfjnpUbzkfUGo1Wg0yhRD/I3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RtDj4kjXQHcvkPNqLOciJfgK9o2uMkx7+e6I20+8vFD1PFvteJhpRTtbcT9BWNlB3 vdrxJnK+my43MGIlWax/+JmVCW24W0dojt7fIadApe4vL/MMUsSxsNOKlAJfVkBERw fpaxX49lk2zK+SCWezNUM7piUTxMTKvgMg9UfpXS31o8zI9EVQqpnXySyhGU7jWfI7 VhqEuN3j+pTiGqaYjppTUR6pn6RCx4PZ4Omi0eNZioAX6P8vQM7+OJeFyvL8JiEbKV 0K0oShESbv1vSjvPK6+OqEOsMfqrNScicc7odv8y75mpRSXN6v+FyqCiHcSFtPORz7 rRLYn0fzGj7JA== X-Nifty-SrcIP: [133.32.182.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Masahiro Yamada , Tom Rix , llvm@lists.linux.dev Subject: [PATCH 2/3] Kconfig.debug: add toolchain checks for DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Date: Mon, 3 Oct 2022 03:11:06 +0900 Message-Id: <20221002181107.51286-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221002181107.51286-1-masahiroy@kernel.org> References: <20221002181107.51286-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT passes the -g option to the command line. The actual DWARF version is up to the toolchain. The combination of GCC and GAS works fine, and Clang with the integrated assembler is good too. The combination of Clang and GAS is a bit tricky, but at least, the default -g flag worked until LLVM 14 was released because Clang <=13 defaults to DWARF v4. Clang 14 switched to DWARF v5 by default. Now, CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT has the same issue as addressed by commit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5"). CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y for Clang >= 14 and GAS < 2.35 produces a ton of errors like follows: /tmp/main-c2741c.s: Assembler messages: /tmp/main-c2741c.s:109: Error: junk at end of line, first unrecognized character is `"' /tmp/main-c2741c.s:109: Error: file number less than one Add 'depends on' to check toolchains. Signed-off-by: Masahiro Yamada --- lib/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f4b2165f24db..cc90414d492e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -253,6 +253,7 @@ config DEBUG_INFO_NONE config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT bool "Rely on the toolchain's implicit default DWARF version" select DEBUG_INFO + depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502) help The implicit default version of DWARF debug info produced by a toolchain changes over time. -- 2.34.1