From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from condef-02.nifty.com (condef-02.nifty.com [202.248.20.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 910087F for ; Sat, 24 Sep 2022 06:49:46 +0000 (UTC) Received: from conssluserg-03.nifty.com ([10.126.8.82])by condef-02.nifty.com with ESMTP id 28O6iGJt008875 for ; Sat, 24 Sep 2022 15:44:16 +0900 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 28O6hxD5012703 for ; Sat, 24 Sep 2022 15:43:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 28O6hxD5012703 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1664001840; bh=BrB/d9GLo7Y+hIxSma9xiwLjfmTb240J0ExFJfaukvc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jA3Bs6pYeQ4B0Y2UNfTeO4t0CbQWWtApoDi6B3PKQbNNamW+uI11jKaYEDJeG7L/A duEoBMFdDwYagjXGH9OSoRC4td0JOh3VBj2QPjmUBU6T4D/DvI7z2t6q+SMGLINZzW fRHj6JdqXBiVp6d4LDMwFPkwpXp57y0S5ujtmJy2dVbEOMY38FIfzBQ/UtVWURJIp+ ALzaoi/uaCExLe+CxZ5maHWB0uhZKq/MBroL8E2HGfgM9ijOYab8APcqKHnOEvMSzQ vBJ6aWMY/3IbmeNa+/763oyfv9vvZE28QjQrPoP3OxQGoyLDKIXK40dosc3b23i8m1 hzZ1jY9eXyF+A== X-Nifty-SrcIP: [209.85.210.44] Received: by mail-ot1-f44.google.com with SMTP id r22-20020a9d7516000000b00659ef017e34so1291956otk.13 for ; Fri, 23 Sep 2022 23:43:59 -0700 (PDT) X-Gm-Message-State: ACrzQf1aEF+USYqgY9ZTRqFo8ojiMUjzVXPweV4gz1sxc8S7xsg2rW6/ 0FaErg1bzu6AZVZP/gWZpV21Cvo+58b9ctw4Jyk= X-Google-Smtp-Source: AMsMyM5uHnH+GtLwvwpxHGwGqJliKbqPhsHZxCRP03wo/6E3AokdAm0Mto/u5ftDq0kJAladauu2e6jL4Ed8TI598Z8= X-Received: by 2002:a05:6830:3115:b0:658:ea61:249c with SMTP id b21-20020a056830311500b00658ea61249cmr5736448ots.225.1664001838616; Fri, 23 Sep 2022 23:43:58 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220919174547.3730737-1-ndesaulniers@google.com> In-Reply-To: From: Masahiro Yamada Date: Sat, 24 Sep 2022 15:43:22 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4] Makefile.debug: re-enable debug info for .S files To: Nick Desaulniers Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , Bill Wendling , Greg Thelen , Alexey Alexandrov , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" On Sat, Sep 24, 2022 at 11:20 AM Nick Desaulniers wrote: > > On Fri, Sep 23, 2022 at 7:12 PM Masahiro Yamada wrote: > > > > This patch still misses the debug info for *.S files > > for the combination of LLVM_IAS=0 and > > CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y > > because, as the comment says, Clang does not pass -g down to GAS. > > > > > > With "[v4] Makefile.debug: set -g unconditional on CONFIG_DEBUG_INFO_SPLIT" > > and this one applied, > > > > > > > > $ grep CONFIG_DEBUG_INFO_DWARF .config > > CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y > > # CONFIG_DEBUG_INFO_DWARF4 is not set > > # CONFIG_DEBUG_INFO_DWARF5 is not set > > $ make LLVM=1 LLVM_IAS=0 arch/x86/kernel/irqflags.o > > SYNC include/config/auto.conf.cmd > > SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h > > SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h > > SYSTBL arch/x86/include/generated/asm/syscalls_64.h > > HOSTCC arch/x86/tools/relocs_32.o > > [snip] > > AS arch/x86/kernel/irqflags.o > > $ objdump -h arch/x86/kernel/irqflags.o | grep debug > > $ > > > > > > > > > > > > > > > > > > I think the following fix-up is needed on top. > > > > > > > > > > diff --git a/scripts/Makefile.debug b/scripts/Makefile.debug > > index d6aecd78b942..8cf1cb22dd93 100644 > > --- a/scripts/Makefile.debug > > +++ b/scripts/Makefile.debug > > @@ -1,4 +1,5 @@ > > -DEBUG_CFLAGS := -g > > +DEBUG_CFLAGS := > > +debug-flags-y := -g > > > > ifdef CONFIG_DEBUG_INFO_SPLIT > > DEBUG_CFLAGS += -gsplit-dwarf > > > > > > > > > > Then, I can see the debug sections. > > > > > > > > $ make LLVM=1 LLVM_IAS=0 arch/x86/kernel/irqflags.o > > CALL scripts/checksyscalls.sh > > DESCEND objtool > > AS arch/x86/kernel/irqflags.o > > $ objdump -h arch/x86/kernel/irqflags.o | grep debug > > 6 .debug_line 00000050 0000000000000000 0000000000000000 0000008f 2**0 > > 7 .debug_info 0000002e 0000000000000000 0000000000000000 000000f8 2**0 > > 8 .debug_abbrev 00000014 0000000000000000 0000000000000000 000001d0 2**0 > > 9 .debug_aranges 00000030 0000000000000000 0000000000000000 000001f0 2**4 > > 10 .debug_str 0000004d 0000000000000000 0000000000000000 00000250 2**0 > > > > > > > > > > > > If you agree, I can locally fix it up as such. > > Ah, sorry I missed testing that combination. Thanks for your > thoroughness. Yes please apply that diff on top. > -- > Thanks, > ~Nick Desaulniers Applied to linux-kbuild with the fixup. -- Best Regards Masahiro Yamada