[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5bcf1c62-80ac-4523-6e2f-b4b788909a26@roeck-us.net>
Date: Sat, 28 May 2022 23:33:07 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Masahiro Yamada <masahiroy@...nel.org>,
linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Guo Ren <guoren@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>,
Sami Tolvanen <samitolvanen@...gle.com>,
linux-csky@...r.kernel.org
Subject: Re: [PATCH] kbuild: ignore *.cmd files for objects that come from
libgcc.a
On 5/28/22 21:23, Masahiro Yamada wrote:
> 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 <linux@...ck-us.net>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
Tested-by: Guenter Roeck <linux@...ck-us.net>
> ---
>
> 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} ;;
> *)
Powered by blists - more mailing lists