diff mbox series

MIPS: boot/compressed/: add __ashldi3 to target for ZSTD compression

Message ID 20211119175052.401771-1-paul@crapouillou.net (mailing list archive)
State Accepted
Commit fbf3bce458214bb971d3d571515b3b129eac290b
Headers show
Series MIPS: boot/compressed/: add __ashldi3 to target for ZSTD compression | expand

Commit Message

Paul Cercueil Nov. 19, 2021, 5:50 p.m. UTC
Just like before with __bswapdi2(), for MIPS pre-boot when
CONFIG_KERNEL_ZSTD=y the decompressor function will use __ashldi3(), so
the object file should be added to the target object file.

Fixes these build errors:

mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_buildDTable_internal':
decompress.c:(.text.FSE_buildDTable_internal+0x48): undefined reference to `__ashldi3'
mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_decompress_wksp_body_default':
decompress.c:(.text.FSE_decompress_wksp_body_default+0xa8): undefined reference to `__ashldi3'
mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `ZSTD_getFrameHeader_advanced':
decompress.c:(.text.ZSTD_getFrameHeader_advanced+0x134): undefined reference to `__ashldi3'

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 arch/mips/boot/compressed/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Randy Dunlap Nov. 19, 2021, 10:34 p.m. UTC | #1
On 11/19/21 9:50 AM, Paul Cercueil wrote:
> Just like before with __bswapdi2(), for MIPS pre-boot when
> CONFIG_KERNEL_ZSTD=y the decompressor function will use __ashldi3(), so
> the object file should be added to the target object file.
> 
> Fixes these build errors:
> 
> mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_buildDTable_internal':
> decompress.c:(.text.FSE_buildDTable_internal+0x48): undefined reference to `__ashldi3'
> mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_decompress_wksp_body_default':
> decompress.c:(.text.FSE_decompress_wksp_body_default+0xa8): undefined reference to `__ashldi3'
> mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `ZSTD_getFrameHeader_advanced':
> decompress.c:(.text.ZSTD_getFrameHeader_advanced+0x134): undefined reference to `__ashldi3'
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

I haven't seen this build error but the patch looks
fine to me.

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>   arch/mips/boot/compressed/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> index 2861a05c2e0c..f27cf31b4140 100644
> --- a/arch/mips/boot/compressed/Makefile
> +++ b/arch/mips/boot/compressed/Makefile
> @@ -52,7 +52,7 @@ endif
>   
>   vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
>   
> -vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o
> +vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o $(obj)/ashldi3.o
>   
>   targets := $(notdir $(vmlinuzobjs-y))
>   
>
Thomas Bogendoerfer Nov. 25, 2021, 9:32 a.m. UTC | #2
On Fri, Nov 19, 2021 at 05:50:52PM +0000, Paul Cercueil wrote:
> Just like before with __bswapdi2(), for MIPS pre-boot when
> CONFIG_KERNEL_ZSTD=y the decompressor function will use __ashldi3(), so
> the object file should be added to the target object file.
> 
> Fixes these build errors:
> 
> mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_buildDTable_internal':
> decompress.c:(.text.FSE_buildDTable_internal+0x48): undefined reference to `__ashldi3'
> mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_decompress_wksp_body_default':
> decompress.c:(.text.FSE_decompress_wksp_body_default+0xa8): undefined reference to `__ashldi3'
> mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `ZSTD_getFrameHeader_advanced':
> decompress.c:(.text.ZSTD_getFrameHeader_advanced+0x134): undefined reference to `__ashldi3'
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  arch/mips/boot/compressed/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
> index 2861a05c2e0c..f27cf31b4140 100644
> --- a/arch/mips/boot/compressed/Makefile
> +++ b/arch/mips/boot/compressed/Makefile
> @@ -52,7 +52,7 @@ endif
>  
>  vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
>  
> -vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o
> +vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o $(obj)/ashldi3.o
>  
>  targets := $(notdir $(vmlinuzobjs-y))
>  
> -- 
> 2.33.0

applied to mips-fixes.

Thomas.
diff mbox series

Patch

diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 2861a05c2e0c..f27cf31b4140 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -52,7 +52,7 @@  endif
 
 vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o
 
-vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o
+vmlinuzobjs-$(CONFIG_KERNEL_ZSTD) += $(obj)/bswapdi.o $(obj)/ashldi3.o
 
 targets := $(notdir $(vmlinuzobjs-y))