From patchwork Sun May 29 04:23:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12864121 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 307FEC433EF for ; Sun, 29 May 2022 04:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbiE2E0L (ORCPT ); Sun, 29 May 2022 00:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbiE2E0L (ORCPT ); Sun, 29 May 2022 00:26:11 -0400 Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E00F7DE33; Sat, 28 May 2022 21:26:09 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-10.nifty.com with ESMTP id 24T4OKH3029656; Sun, 29 May 2022 13:24:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 24T4OKH3029656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1653798261; bh=WgaQtVymYkfxno5Ib+Fa54x8BPz4yryvYeF7xl9EODg=; h=From:To:Cc:Subject:Date:From; b=zsV8tR9zXqniwmpEJ/qCn03wSp3qPltpelAdYMS/qCxo/YX3OoWDgsgmCVSiI1xXg GEYty+3PUM+eDQuA0GOm3AgEx7KISitDWgJmPD5AzHxPqj1ITv+NFIA+bbsshioT+Y 7mxe4q6FiaXuoXjtZYIpFke8iPVe5EnQEOA+a94FgOmAcnMwofNPbioBvw55jk7CYd 9VpqKSA8wX2upuxxrV1SaO0lcvkM1WvRUDIWS8qj57Bc4fgetKaCyjYiKHfi8z6oi/ 5yHHYo1YSsrRk1J55fYIH1E00sk3F1G/Ey/k5PbPW8sun2pPkxH2ovZ1lagNJSvKnh bi8FKgxiCHGmQ== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Guenter Roeck , Masahiro Yamada , Guo Ren , Michal Marek , Nick Desaulniers , Nicolas Schier , Sami Tolvanen , linux-csky@vger.kernel.org Subject: [PATCH] kbuild: ignore *.cmd files for objects that come from libgcc.a Date: Sun, 29 May 2022 13:23:18 +0900 Message-Id: <20220529042318.2630379-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Guenter Roeck reported the build breakage for parisc and csky. I confirmed nios2 and openrisc are broken as well. The reason is that they borrow libgcc.a from the toolchains. For example, see this line in arch/parisc/Makefile: LIBGCC := $(shell $(CC) -print-libgcc-file-name) Some objects in libgcc.a are linked to vmlinux.o, but they do not have .*.cmd files. Obviously, there is no EXPORT_SYMBOL in external objects. Ignore them. (Most of the architectures import library code into the kernel tree. Perhaps those 4 architectures can do similar, but I am not sure.) Fixes: f292d875d0dc ("modpost: extract symbol versions from *.cmd files") Link: https://lore.kernel.org/linux-kbuild/20220528224745.GA2501857@roeck-us.net/T/#mac65c20c71c3e272db0350ecfba53fcd8905b0a0 Reported-by: Guenter Roeck Signed-off-by: Masahiro Yamada Tested-by: Guenter Roeck --- scripts/link-vmlinux.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index a7f6196c7e41..68e4be463a76 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -344,9 +344,16 @@ ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1 modpost_link vmlinux.o objtool_link vmlinux.o -# Generate the list of objects in vmlinux +# Generate the list of in-tree objects in vmlinux +# +# This is used to retrieve symbol versions generated by genksyms. for f in ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS}; do case ${f} in + *libgcc.a) + # Some architectures do '$(CC) --print-libgcc-file-name' to + # borrow libgcc.a from the toolchain. + # There is no EXPORT_SYMBOL in external objects. Ignore this. + ;; *.a) ${AR} t ${f} ;; *)