Skip to content

Commit cddc40f

Browse files
arndbtsbogend
authored andcommitted
mips: always link byteswap helpers into decompressor
My series to clean up the unaligned access implementation across architectures caused some mips randconfig builds to fail with: mips64-linux-ld: arch/mips/boot/compressed/decompress.o: in function `decompress_kernel': decompress.c:(.text.decompress_kernel+0x54): undefined reference to `__bswapsi2' It turns out that this problem has already been fixed for the XZ decompressor but now it also shows up in (at least) LZO and LZ4. From my analysis I concluded that the compiler could always have emitted those calls, but the different implementation allowed it to make otherwise better decisions about not inlining the byteswap, which results in the link error when the out-of-line code is missing. While it could be addressed by adding it to the two decompressor implementations that are known to be affected, but as this only adds 112 bytes to the kernel, the safer choice is to always add them. Fixes: c50ec67 ("MIPS: zboot: Fix the build with XZ compression on older GCC versions") Fixes: 0652035 ("asm-generic: unaligned: remove byteshift helpers") Link: https://lore.kernel.org/linux-mm/202106301304.gz2wVY9w-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202106260659.TyMe8mjr-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202106172016.onWT6Tza-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202105231743.JJcALnhS-lkp@intel.com/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent cf02ce7 commit cddc40f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/mips/boot/compressed/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ GCOV_PROFILE := n
4040
UBSAN_SANITIZE := n
4141

4242
# decompressor objects (linked with vmlinuz)
43-
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
43+
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
4444

4545
ifdef CONFIG_DEBUG_ZBOOT
4646
vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT) += $(obj)/dbg.o
@@ -54,7 +54,7 @@ extra-y += uart-ath79.c
5454
$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
5555
$(call cmd,shipped)
5656

57-
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o
57+
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
5858

5959
extra-y += ashldi3.c
6060
$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE

0 commit comments

Comments
 (0)