Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp319881pxb; Fri, 15 Jan 2021 14:05:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzDELkP0UYWLuMSOuNUA0aEv12s6hnVNa/Z0SCil6aZX/u8mYzXfQU81wdFZXuH+OuzarX X-Received: by 2002:aa7:c919:: with SMTP id b25mr10868834edt.108.1610748325052; Fri, 15 Jan 2021 14:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610748325; cv=none; d=google.com; s=arc-20160816; b=DVnao5uaazil7gaFaH+QLAPUDj+OQxHRmrBx4UZCUnnGN31716lj/uEljQw5cfeBuY /Pus2A0LD1RxeJDvNzfP/I/OyF5wPT9xpuL/Nz72jbxhNEVl8ua/DtLvgL/vDBIGuNa9 Yedou+H9o6uAI3lNTdaIE+9rf0hZ/5e6mfO4YS4UwwogS7vX9mKbsG0WQ6dYSwEiJeoA wwMfJDa0GxV04G8plwETsN4ItsrXTUNOsDIJq1/tcVMevmn6wQ8OV0IcW3+4f/t7RDTb 4BBCIr3e1uqO8JP3IEa3jT/9AaJCEYIXaqDeR4+tWyfnyL5rvvAWxnyqmryS5ZQTAbwx 6DHw== 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:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=tH8Dd34wEyfZ8To5q7YwlSddVn5ZC+wDT5td0wwyUuk=; b=Esct2gxgg+WHsR5S0QA0zsT3hO2iLudN88lpa4QzdcA9s+ioawBo7BJG9tVfBjlhVY WXVOJW0a62ncJ81vnaLrf2ygGXSwck4L0U+psuL1Ni++D1ymIElAiqeSSmQbHZ2n69iz dsZUfgdNPIyJWImMIhHu4b16yjYEm1F/1vwfSysqs+KNiJQsy47k+qXbY859cc47i1iw 9FAIxItQmeYbt2q9M/a9y9J4Td6jWamJM5hZQPFodx09wJpWlrvBo4MyfYtKVfT8psHT 1mRWk7Rrv/Lhh4H2bdxsSZB81v/rVMjkwZsRXivmiPO1IMK9fgtc3EYN244Mn1i5GUXg 2VEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dYvn+9zA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si4260454eji.695.2021.01.15.14.05.00; Fri, 15 Jan 2021 14:05: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=@gmail.com header.s=20161025 header.b=dYvn+9zA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbhAOWEG (ORCPT + 99 others); Fri, 15 Jan 2021 17:04:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbhAOWEF (ORCPT ); Fri, 15 Jan 2021 17:04:05 -0500 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 298BBC061757; Fri, 15 Jan 2021 14:03:25 -0800 (PST) Received: by mail-io1-xd2c.google.com with SMTP id z5so21018110iob.11; Fri, 15 Jan 2021 14:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=tH8Dd34wEyfZ8To5q7YwlSddVn5ZC+wDT5td0wwyUuk=; b=dYvn+9zA8P3938yyld3jbcIUaxmBOhcHz64JaegN4ZtOxkFwFJiAK7+rcU1eKEHPdn ORGa5on80grzxAz8UG7eUjKuXOKbUvtdRnfqIYS6EWgYYsjT1HaZAOhXktZzti77b0+4 s5ew8kSS/vmdtEMC85XSGSYgc7OWs4Uad5S8BHb+kU6hutLIsJ4Bd7lwCHNq9b8N7vbS X50kDtHThbWqhswHsqh5i1DNgZntvB5DwtcUfUexRDMlG9S1wQMtlfG/7s1pO4B7gGFO Cmt8U01g5UT6HYv3W8DOLCNL5V7j7dK9Fjgbc2ZO0uS+jgs0AgEQCYuUvpmPwBah6FTC xCGA== 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:reply-to :from:date:message-id:subject:to:cc; bh=tH8Dd34wEyfZ8To5q7YwlSddVn5ZC+wDT5td0wwyUuk=; b=ZwMi68o9DlEPKIFSMF03IbUkB7ZiziqKnkuR4bBffRpk+KRr109hZRKWg1amSxKyUX BRnkIRpogy2M59XsDkjDu8ZKuTxuP3FwC+IBZGs7bN0Aohcz8M1DCMRGxktwzqKvRJCO x+5EoAsobPXfbxAps2BA4ySfMw2TxaFNY4T9tBzh6RRUGPx81rOP2kWQorRl56k9uZAN d89lSlYzDuQQF3Uy8eNRUqn6x8WfXwj/5yqQdmFRAB3CeacULJMbuWkB8h/54OjsOibh rfj23Ycnr7CJaHtmDE8mDuyQVDzEDTNWF7xJhbeZxy/KTucTHPyjCZLhY+ot/dj3EwyM H1Rw== X-Gm-Message-State: AOAM5322IN/WpX0yIQAY3dlQSGYWXqGPM0oaIuls2UI7lkisPq91oIfU OQvYO7MFn+cgQbe7Snjffq/BSDr/M+R/WmPSG1c= X-Received: by 2002:a02:b78e:: with SMTP id f14mr4458589jam.97.1610748204486; Fri, 15 Jan 2021 14:03:24 -0800 (PST) MIME-Version: 1.0 References: <20210115210616.404156-1-ndesaulniers@google.com> <20210115210616.404156-2-ndesaulniers@google.com> <20210115215958.3cqewpk7hycfr3hm@google.com> In-Reply-To: <20210115215958.3cqewpk7hycfr3hm@google.com> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Fri, 15 Jan 2021 23:03:13 +0100 Message-ID: Subject: Re: [PATCH v5 1/3] Remove $(cc-option,-gdwarf-4) dependency from CONFIG_DEBUG_INFO_DWARF4 To: Fangrui Song Cc: Nick Desaulniers , Masahiro Yamada , Nathan Chancellor , Andrew Morton , linux-kernel@vger.kernel.org, Clang-Built-Linux ML , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 11:00 PM Fangrui Song wrote: > > 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. > Good catch Fangrui. Yesterday, I wondered - after a cut-n-paste from the patch's changelog - why I did not see anything --dwarfX related in my logs. - Sedat - > >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 > >