Skip to content

Commit 4e2764e

Browse files
arndbgregkh
authored andcommitted
mips: always link byteswap helpers into decompressor
[ Upstream commit cddc40f ] 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/[email protected]/ Link: https://lore.kernel.org/linux-mm/[email protected]/ Link: https://lore.kernel.org/linux-mm/[email protected]/ Link: https://lore.kernel.org/linux-mm/[email protected]/ Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 53c5c24 commit 4e2764e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/mips/boot/compressed/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ KCOV_INSTRUMENT := n
3939
UBSAN_SANITIZE := n
4040

4141
# decompressor objects (linked with vmlinuz)
42-
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
42+
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
4343

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

56-
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o
56+
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
5757

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

0 commit comments

Comments
 (0)