Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: zboot: Fix the build with XZ compression on older GCC versions

Some older GCC version (at least 4.6) emits calls to __bswapsi2() when
building the XZ decompressor. The link of the compressed image then
fails with the following error:

arch/mips/boot/compressed/decompress.o: In function '__fswab32':
include/uapi/linux/swab.h:60: undefined reference to '__bswapsi2'

Add bswapsi.o to the link to fix the build with these versions.

Signed-off-by: Alban Bedel <albeu@free.fr>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12232/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Alban Bedel and committed by
Ralf Baechle
c50ec678 62d8e644

+3 -3
+3 -3
arch/mips/boot/compressed/Makefile
··· 39 39 vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY) += $(obj)/uart-alchemy.o 40 40 endif 41 41 42 - vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o 42 + vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o 43 43 44 - $(obj)/ashldi3.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib 45 - $(obj)/ashldi3.c: $(srctree)/arch/mips/lib/ashldi3.c 44 + $(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib 45 + $(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c 46 46 $(call cmd,shipped) 47 47 48 48 targets := $(notdir $(vmlinuzobjs-y))