Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp318283pxb; Fri, 15 Jan 2021 14:03:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxUfJQXAm05BJ+xyU8drtvBqCtJln2agUq5zjYIgZdaPj74OXDWcD7U3+Two0vdq5+u4pE X-Received: by 2002:a05:6402:22d6:: with SMTP id dm22mr11132260edb.255.1610748190597; Fri, 15 Jan 2021 14:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610748190; cv=none; d=google.com; s=arc-20160816; b=XDLolHMc7V0vBJBZ7gx20YWTSlDXzbBS+4xvLQd0anMoaYZCeJcQzGv7KFOPB+PUFU Z/vXCHOEO6tco6F+N2bVHbTUCrm2IJUfF1wBjkMkaLrCg3HssfR7y0xX9jrVxI3zkjxX Lq6ax05Dt35CtOGDMgTYB87OjKYq5z+R1FjANDYZqrvgbZ9f/eJGtWYSrLPX1/BKG+W9 puDj/EfsrEjj4LJgBVIVepJ8OZdwicucC0Bs7Wa8QVwOhF/s+izdO5pcYUkLmbFoKk92 hvf438NI9+etKHOGGf8szh8tBWyNPkIuz92rg/EUXL0DKgx+osDF5KUPjIo4fuqjyfU3 qLIA== 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=t+cXnlBFq8WTb5dbUuQjMhr2A9oyhYcZeyKpPnSTr6w=; b=DzvxEQ+1zKvQf9cs9TWz5Sg5NgPwMztX2h4I+3Os9EiTxfJaQJ+UavNQKsnGaZ4/Tk rOZzuQ01PVFpsHK3VLdPWPcPfAxEuKq+4z03QtdsZd4nP+pb9nER6IyuWShsGLvO8R84 nz9IIl7aXEH1rwHMLcu8bQC+vlS81dBqDra+znq0XI/BxztWZLaIppSQd6mx1Qd/tyCh wfOaLHWnYgXf3Z5JI5kospAd6R7gTkjpiy64KQHQ+BqTh3UELL1Vu7V/JmOK5rP/xtgJ Oz/c4bIx7aWXV+88FBisk5GTtQYZMdGVr0/6c9S2F1Bw8nzAClyE3nAqoO0xAb1+Suh1 8nbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QLLEcyFZ; 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 b12si5206670edq.488.2021.01.15.14.02.47; Fri, 15 Jan 2021 14:03:10 -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=QLLEcyFZ; 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 S1727207AbhAOWAo (ORCPT + 99 others); Fri, 15 Jan 2021 17:00:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbhAOWAn (ORCPT ); Fri, 15 Jan 2021 17:00:43 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE54EC061757 for ; Fri, 15 Jan 2021 14:00:02 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id q4so5391037plr.7 for ; Fri, 15 Jan 2021 14:00:02 -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=t+cXnlBFq8WTb5dbUuQjMhr2A9oyhYcZeyKpPnSTr6w=; b=QLLEcyFZlJw4ynxsEl/y7diypFyFaKmWF4wjvz1MVPrhe8yqb7TUO+Ovl53eFy26Zv Vyg5Vk3uZvPqK6588DPWboXivEXa3KNLyYY/5n2ObfYjdy4O8kNybJEOXXl4z31Wu3tg WeoiETvHF9c1TpKB8iy6QCpos8IBMCYYU3wG2Vc8MjyO2spULnzUloAeRMeO6+qIeouz d1Ichh/XhTrAxPSBVitupF2zoFqmu3mNARKz4godC+9BNADtNnj9GLukfhzs1afjTJw5 DwF4Syp3TUFPUuyh9EkhGKWCv+2155I4WZAM7aFVKXa79UtaLT6u/71833Pwz4pTBnli 4pkQ== 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=t+cXnlBFq8WTb5dbUuQjMhr2A9oyhYcZeyKpPnSTr6w=; b=Ani7cXALPgQQV/jLJLXZCVRzs5TKUM72kgHlHNSt61HjOSB/ZMGaUeqkn1CSvt2o6h Ba2XzCxQSpg49tMBMih9bPCo+LuT0jkgb2BmCBGvmK7tt5+InHpj3vAO6JDqqrrcboQY ciYtwKl9j33VgWjT6qHRjdOTdg6hn4hafYX700HMJaaXEyPgHj/U7PUOy4mO1428Clid KH7OrtTaOa5rT5MgDfa9IH2fCKuhEW6DDNhuCnT1fPIKKrUMK2YnP5xM42Ygbf7093+n 404au3vkOf6Cdp8j+yOP4X4/Wgy8g5CaPIoIwpvelMAM9hXUu92HvozTD5JAWrc+WMk5 vlGg== X-Gm-Message-State: AOAM533x/hGhsETNlQZT/e9xEkWq37Hv55yeJVistysOf1j4RQXJNByr 53kkPJdmGI5+e2ZERHeFJAhFew== X-Received: by 2002:a17:90a:5b:: with SMTP id 27mr12832398pjb.207.1610748002351; Fri, 15 Jan 2021 14:00:02 -0800 (PST) Received: from google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) by smtp.gmail.com with ESMTPSA id 14sm8710459pfi.131.2021.01.15.14.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:00:01 -0800 (PST) Date: Fri, 15 Jan 2021 13:59:58 -0800 From: Fangrui Song To: Nick Desaulniers Cc: Masahiro Yamada , Nathan Chancellor , Andrew Morton , Sedat Dilek , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, Jakub Jelinek , Caroline Tice , Nick Clifton , Yonghong Song , Jiri Olsa , Andrii Nakryiko , Arnaldo Carvalho de Melo Subject: Re: [PATCH v5 1/3] Remove $(cc-option,-gdwarf-4) dependency from CONFIG_DEBUG_INFO_DWARF4 Message-ID: <20210115215958.3cqewpk7hycfr3hm@google.com> References: <20210115210616.404156-1-ndesaulniers@google.com> <20210115210616.404156-2-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210115210616.404156-2-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-15, Nick Desaulniers wrote: >From: Masahiro Yamada > >The -gdwarf-4 flag is supported by GCC 4.5+, and also by Clang. > >You can see it at https://godbolt.org/z/6ed1oW > > For gcc 4.5.3 pane, line 37: .value 0x4 > For clang 10.0.1 pane, line 117: .short 4 > >Given Documentation/process/changes.rst stating GCC 4.9 is the minimal >version, this cc-option is unneeded. > >Note >---- > >CONFIG_DEBUG_INFO_DWARF4 controls the DWARF version only for C files. > >As you can see in the top Makefile, -gdwarf-4 is only passed to CFLAGS. > > ifdef CONFIG_DEBUG_INFO_DWARF4 > DEBUG_CFLAGS += -gdwarf-4 > endif > >This flag is used when compiling *.c files. > >On the other hand, the assembler is always given -gdwarf-2. > > KBUILD_AFLAGS += -Wa,-gdwarf-2 > >Hence, the debug info that comes from *.S files is always DWARF v2. >This is simply because GAS supported only -gdwarf-2 for a long time. > >Recently, GAS gained the support for --dwarf-[3|4|5] options. [1] The gas commit description has a typo. The supported options are -gdwarf-[345] or --gdwarf-[345]. -gdwarf2 and --gdwarf2 are kept for compatibility. Looks good otherwise. >And, also we have Clang integrated assembler. So, the debug info >for *.S files might be improved if we want. > >In my understanding, the current code is intentional, not a bug. > >[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=31bf18645d98b4d3d7357353be840e320649a67d > >Reviewed-by: Nick Desaulniers >Reviewed-by: Nathan Chancellor >Signed-off-by: Masahiro Yamada >--- > lib/Kconfig.debug | 1 - > 1 file changed, 1 deletion(-) > >diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug >index 78361f0abe3a..dd7d8d35b2a5 100644 >--- a/lib/Kconfig.debug >+++ b/lib/Kconfig.debug >@@ -258,7 +258,6 @@ config DEBUG_INFO_SPLIT > > config DEBUG_INFO_DWARF4 > bool "Generate dwarf4 debuginfo" >- depends on $(cc-option,-gdwarf-4) > help > Generate dwarf4 debug info. This requires recent versions > of gcc and gdb. It makes the debug information larger. >-- >2.30.0.284.gd98b1dd5eaa7-goog >