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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50D5BCC6B33 for ; Thu, 15 Oct 2026 15:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NU7K2eoDiKbkqv4c0IQTEM9QEM3a+W4vg5Ui6TKEtAk=; b=IXuy3Zg4zxh9Ru R4Df1E6JQWTdr/EbmqK18ttCJPfZd3FZEERYHa1SCWIsPr/XUHuQEb4RA5s9qm0LTch0ljmpSsOia TlnX4jlwwv0i3k8YguOEXRVv7m3QoofaqksNIPxwjni676eCm08WnZJ39qdwsd3kTUT7tth2hVl6j nvKsJQD4Jdr+We1kTto2fqTOHO4whcFBQ+Jm5M1AAWUzfkST2I/8HLC62D4Xw/rhNkuA+CjZTDp+y MHdVbxYpX96efEx2y4eC1y/LgIrMFTgNZ8Jvki6Yvr2Ex4Vqh4YmUFTTqmc/nJnlLmCzQ8iBkplwI pfdHvnTe4B+zlFIIQX4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xHNZY-00000000apI-3fhF; Thu, 15 Oct 2026 15:40:48 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xHNZW-00000000aol-34ww for linux-snps-arc@lists.infradead.org; Thu, 15 Oct 2026 15:40:46 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 32F36408CA; Thu, 15 Oct 2026 15:40:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 571CC1F000C4; Thu, 15 Oct 2026 15:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792078846; bh=ddZjtjOCh5jlTMGXe/i/6le28DxCfsrE+liYqQ3Dqgs=; h=From:To:Cc:Subject:Date; b=MbtBene2qfbMlfoweEAJtIgbeH2a7u6WX0U5uZaJfB8tnaTJREw0iGg7sNQ0KwEQH qMN8U2VahNYDiNejGgexzLSNmc7XNeqs/3nbBbptKMa16FCo8JoCDRGIxuqWqgF/b9 yX5AZFfgv5urGbajMrUboGfxL88OuC+zfia+J7RbF0Cr9ycHDzLGpLNDIkNota7wBT C5cw4UpRjvvtVmF9+d/BDcON5d7pQOF7gFaTxJ6yKofJ0Nci2Jd8X98M2h/caNx4wY 13qU1+P7vf3VK2hN91pmh4akUZSHBONpEv41wmLlsf1E6NeEugjz7JYq6hthbw09/9 3CDazGAjge/vg== From: Sasha Levin To: Vineet Gupta , linux-snps-arc@lists.infradead.org Cc: Andrii Nakryiko , Ilya Leoshkevich , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Sasha Levin Subject: [PATCH] ARC: Strip libgcc debug information when generating BTF Date: Thu, 15 Oct 2026 11:40:44 -0400 Message-ID: <20261015154044.4058618-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org ARC links against the compiler's libgcc archive. The ARC GNU 2023.03 toolchain ships this library with debug information, including complex floating-point types in integer arithmetic helpers such as __udivdi3. These types reach vmlinux even though the kernel does not use complex floating-point arithmetic. When floating-point BTF encoding is enabled, pahole rejects those types: Complex, interval and imaginary float types are not supported Error while encoding BTF. FAILED: load BTF from .tmp_vmlinux1.BTF.1: No such file or directory KernelCI's upgrade to pahole 1.31 exposed this long-standing problem as failed ARC builds. As of 1.32, pahole still rejects these types, and older versions will stay in use, so the kernel build has to keep them out of vmlinux. Commit f122668ddcce ("ARC: Add eBPF JIT support") documented the same failure along with a workaround of disabling floating-point BTF encoding, but that also discards supported floating-point types from kernel BTF. For CONFIG_DEBUG_INFO_BTF, generate a debug-stripped copy of the selected libgcc archive in the output tree and link that copy. Preserve the archive structure so that only needed helpers are linked, and use the normal Kbuild objcopy rule to track input and command changes. The trade-off is that vmlinux in BTF-enabled builds no longer carries DWARF for the libgcc helpers. Debug information for kernel code, the installed toolchain and non-BTF builds stay unchanged. Reproduced and tested with ARC GCC 12.2.1 and pahole 1.31 and 1.32 using an ARCv2 tinyconfig with BPF_SYSCALL and DWARF4/BTF enabled. Before and after vmlinux.o files are identical after stripping debug information. Fixes: db16c1fe92d7 ("bpf: Generate BTF_KIND_FLOAT when linking vmlinux") Link: https://github.com/kernelci/kernelci-core/commit/e71b8c9f42253180596e734c18965a5aad80c8c5 Signed-off-by: Sasha Levin --- arch/arc/Makefile | 9 ++++++++- arch/arc/lib/Makefile | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arc/Makefile b/arch/arc/Makefile index 868805ffcfeab..4ea705a331c7c 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -86,7 +86,14 @@ core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/ core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/ core-$(CONFIG_ARC_SOC_HSDK) += arch/arc/plat-hsdk/ -libs-y += arch/arc/lib/ $(LIBGCC) +libs-y += arch/arc/lib/ + +ifdef CONFIG_DEBUG_INFO_BTF +export LIBGCC := $(LIBGCC) +libs-y += arch/arc/lib/libgcc.a +else +libs-y += $(LIBGCC) +endif boot := arch/arc/boot diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile index 30158ae69fd4a..2807ee24f27e6 100644 --- a/arch/arc/lib/Makefile +++ b/arch/arc/lib/Makefile @@ -13,3 +13,11 @@ lib-$(CONFIG_ISA_ARCV2) +=memcpy-archs-unaligned.o else lib-$(CONFIG_ISA_ARCV2) +=memcpy-archs.o endif + +# libgcc can contain complex floating-point debug types unsupported by BTF. +# Strip only the debug information from a local copy of the selected archive. +always-$(CONFIG_DEBUG_INFO_BTF) += libgcc.a +OBJCOPYFLAGS_libgcc.a := --strip-debug + +$(obj)/libgcc.a: $(LIBGCC) FORCE + $(call if_changed,objcopy) -- 2.53.0 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc