From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86891C433E0 for ; Wed, 20 Jan 2021 06:00:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AB552313C for ; Wed, 20 Jan 2021 06:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728838AbhATF7k (ORCPT ); Wed, 20 Jan 2021 00:59:40 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:25119 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728307AbhATF72 (ORCPT ); Wed, 20 Jan 2021 00:59:28 -0500 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 10K5wQ4S006914; Wed, 20 Jan 2021 14:58:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 10K5wQ4S006914 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1611122306; bh=KzN9Ryj1GGQwDPkR8jROwhO9v+XE5tP9xjOAU8GcS3k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ulTaCuOn3vyEdn8KBGk2hvq70GLGLoXtnNsxxxvyqmAvlu5CNXtWUYfTNALZFfhye eIsnTRMDLEAJWKdBjCAOwKrHNJDixKF/PKTpgqYNS5xJnnSoDAqaB7iD9+inMbeCdN b6TH+2+QP5SoDju+EvQAMIrF0V4B0S6x9VwR4590wt8sZx+O/ilrvu9tXNGST1u+7U i73M37VLmsOFgI5Oea7Kl57hfjCVaAkA7i9B3Sw3vvZsNvPVLvmDPB2jZfDm3B2HR6 uAmDqleWyWP9+0xTtN2KAyQ2vr/EpMKvUSVxI1Dw2y6zRXM4oB3ZHSSi/OQSrVz3NW hny0IRyLI+4sg== X-Nifty-SrcIP: [209.85.214.169] Received: by mail-pl1-f169.google.com with SMTP id y8so11923548plp.8; Tue, 19 Jan 2021 21:58:26 -0800 (PST) X-Gm-Message-State: AOAM533ElGezaX44EjPfAqW0jQdiWgxv5MPqNKKWAnc2A4EEWqnOMjv4 wxwHM24Ao9hk+nQXqbTQcPVrC8I8ZsDy7DbtzQs= X-Google-Smtp-Source: ABdhPJy1nJc2rsdYYrJ/8DDEr5wBNawlXcexc+8QcUbO6t9Bql1qctYGmnWNQ1z4azFlQe4RrWaXegHEImZuO0KlNlw= X-Received: by 2002:a17:90b:1b50:: with SMTP id nv16mr3678277pjb.153.1611122305635; Tue, 19 Jan 2021 21:58:25 -0800 (PST) MIME-Version: 1.0 References: <20210115210616.404156-1-ndesaulniers@google.com> <20210115210616.404156-2-ndesaulniers@google.com> In-Reply-To: From: Masahiro Yamada Date: Wed, 20 Jan 2021 14:57:49 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 1/3] Remove $(cc-option,-gdwarf-4) dependency from CONFIG_DEBUG_INFO_DWARF4 To: Nick Desaulniers Cc: Sedat Dilek , Nathan Chancellor , Andrew Morton , LKML , Clang-Built-Linux ML , Linux Kbuild mailing list , linux-arch , Jakub Jelinek , Fangrui Song , 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 Sat, Jan 16, 2021 at 8:54 AM Masahiro Yamada wrote: > > On Sat, Jan 16, 2021 at 6:51 AM Nick Desaulniers > wrote: > > > > On Fri, Jan 15, 2021 at 1:48 PM Sedat Dilek wrote: > > > > > > On Fri, Jan 15, 2021 at 10:06 PM 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] > > > > 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 > > > > > > Subject misses a "kbuild:" label like in all other patches. > > > You have: > > > "Remove $(cc-option,-gdwarf-4) dependency from CONFIG_DEBUG_INFO_DWARF4" > > > > Ack, I wonder how that happened? Ah well, will fix in v6; thanks for > > the feedback. > > > > I will apply this in my tree, > adding "kbuild:" and fixing the typo pointed out by Fangrui. > > You do not need to resend this one. > Applied to linux-kbuild. > > > > > > > > > > > > - Sedat - > > > > > > > --- > > > > 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 > > > > > > > > > > > > -- > > Thanks, > > ~Nick Desaulniers > > > > -- > Best Regards > Masahiro Yamada -- Best Regards Masahiro Yamada