Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1960150rwb; Fri, 23 Sep 2022 23:56:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LabN1SuW0+hQ8Qaut28Tb+sYg/LzyaQc6elIhYoP9j10XBvE3ILXJejzqmOyLqxU4Dd1x X-Received: by 2002:a17:907:7632:b0:76f:f6e7:36cf with SMTP id jy18-20020a170907763200b0076ff6e736cfmr10343129ejc.442.1664002591640; Fri, 23 Sep 2022 23:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664002591; cv=none; d=google.com; s=arc-20160816; b=F7NTjOUoAcw3dAdUJNrtFwCJKjlaEx5aQe5ZES2xpngDIg8UOQ8avlEbHnt3UOVMFt 9RNEqJIQ5yG3k88H9XNdvb5Rjqe28h/g78XfQF8Du01RcfaGC5IJRTOkHbinKmtbIIG4 bcTvSgDViQJ+CMd42vTXxGXAxVamWqPXNbNmlwCJFZgWtHT4tA9eBL0Yir5j1h+vEHcc B0wdLqZqFwyN5Vxjo8l05190EoYodhu0cVGd/ga9tsv75mAAK+gdc+gqDf+x8t+P2g/C IUp0MrvZovEHokcuL6DiCLqUkQ89qvForCI/OCjnBaFcUT0l7/07O6Yf8oe/Tb0VJMc7 T7uw== 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:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=BrB/d9GLo7Y+hIxSma9xiwLjfmTb240J0ExFJfaukvc=; b=cyahAS6ZsJcU0xnek2rIrOr8A5X/1+dSSf8w43DMCjZkdXk8U3CjsNTbQPGV+Trtu5 gk5x6ItKj5QAFhFJE0hEuu4Ql3EKCVDEYNa21W7LguuOYf0q3ITZsIratIbmC9AiXZQ5 mtihUFdu8+dkfyWkeVGOjbOGxqxuJ2GsE7XSHoEW0HEsesCwUL5hmwR21lzz0bjcLTDY McMwzc4SaqpLI4LBFZ6WUR5aG0HrW8Ys0Joe6gbKASImv/v9wQgQSJ4Yskp1WP9KIurT mvrODKABBrlhKMzdQGjDUJDGkCVZc3intz5aKTQqusLvG//H6zZBYzSv1+N9dkKbHlgI yrdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jA3Bs6pY; 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 h15-20020a05640250cf00b00447fc23b420si11333716edb.165.2022.09.23.23.56.02; Fri, 23 Sep 2022 23:56:31 -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=jA3Bs6pY; 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 S233320AbiIXGoT (ORCPT + 99 others); Sat, 24 Sep 2022 02:44:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233102AbiIXGoN (ORCPT ); Sat, 24 Sep 2022 02:44:13 -0400 Received: from conssluserg-02.nifty.com (conssluserg-02.nifty.com [210.131.2.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E66B9AFEA; Fri, 23 Sep 2022 23:44:12 -0700 (PDT) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 28O6hxWo030667; Sat, 24 Sep 2022 15:43:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 28O6hxWo030667 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.47] Received: by mail-ot1-f47.google.com with SMTP id l7-20020a056830154700b0065563d564dfso1357722otp.0; Fri, 23 Sep 2022 23:43:59 -0700 (PDT) X-Gm-Message-State: ACrzQf2e8jF1NcSnihSpwIqKqI9V7QSsqhXdhLoRzYtt/hqF4K9JbxLm fNA2I+LZWwRICDH8w43kRIF0JvcjWc2U7ZI4Cvg= 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) 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" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 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