All of lore.kernel.org
 help / color / mirror / Atom feed
* decompressor.c:undefined reference to `__clzdi2'
@ 2021-07-27 17:27 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-07-27 17:27 UTC (permalink / raw)
  To: Dimitri John Ledkov; +Cc: kbuild-all, linux-kernel, Vasily Gorbik

[-- Attachment #1: Type: text/plain, Size: 2115 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ff1176468d368232b684f75e82563369208bc371
commit: 7b034d9c1b08b3d06ad712283c1115a7fe39e354 s390/boot: add zstd support
date:   6 weeks ago
config: s390-randconfig-r026-20210727 (attached as .config)
compiler: s390-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7b034d9c1b08b3d06ad712283c1115a7fe39e354
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 7b034d9c1b08b3d06ad712283c1115a7fe39e354
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `HUF_decompress1X2_usingDTable_internal':
>> decompressor.c:(.text+0x2152): undefined reference to `__clzdi2'
>> s390-linux-ld: decompressor.c:(.text+0x2392): undefined reference to `__clzdi2'
   s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `HUF_decompress1X4_usingDTable_internal':
   decompressor.c:(.text+0x2d16): undefined reference to `__clzdi2'
   s390-linux-ld: decompressor.c:(.text+0x2db4): undefined reference to `__clzdi2'
   s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `ZSTD_decodeSequenceLong':
   decompressor.c:(.text+0x32a2): undefined reference to `__clzdi2'
   s390-linux-ld: arch/s390/boot/compressed/decompressor.o:decompressor.c:(.text+0x450c): more undefined references to `__clzdi2' follow

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38538 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* decompressor.c:undefined reference to `__clzdi2'
@ 2021-07-27 17:27 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-07-27 17:27 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2152 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ff1176468d368232b684f75e82563369208bc371
commit: 7b034d9c1b08b3d06ad712283c1115a7fe39e354 s390/boot: add zstd support
date:   6 weeks ago
config: s390-randconfig-r026-20210727 (attached as .config)
compiler: s390-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7b034d9c1b08b3d06ad712283c1115a7fe39e354
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 7b034d9c1b08b3d06ad712283c1115a7fe39e354
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `HUF_decompress1X2_usingDTable_internal':
>> decompressor.c:(.text+0x2152): undefined reference to `__clzdi2'
>> s390-linux-ld: decompressor.c:(.text+0x2392): undefined reference to `__clzdi2'
   s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `HUF_decompress1X4_usingDTable_internal':
   decompressor.c:(.text+0x2d16): undefined reference to `__clzdi2'
   s390-linux-ld: decompressor.c:(.text+0x2db4): undefined reference to `__clzdi2'
   s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `ZSTD_decodeSequenceLong':
   decompressor.c:(.text+0x32a2): undefined reference to `__clzdi2'
   s390-linux-ld: arch/s390/boot/compressed/decompressor.o:decompressor.c:(.text+0x450c): more undefined references to `__clzdi2' follow

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38538 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: decompressor.c:undefined reference to `__clzdi2'
  2021-07-27 17:27 ` kernel test robot
@ 2021-07-29 13:29   ` Vasily Gorbik
  -1 siblings, 0 replies; 8+ messages in thread
From: Vasily Gorbik @ 2021-07-29 13:29 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Dimitri John Ledkov, kbuild-all, linux-kernel, kernel test robot

On Wed, Jul 28, 2021 at 01:27:54AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   ff1176468d368232b684f75e82563369208bc371
> commit: 7b034d9c1b08b3d06ad712283c1115a7fe39e354 s390/boot: add zstd support
> date:   6 weeks ago
> config: s390-randconfig-r026-20210727 (attached as .config)
...
>    s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `HUF_decompress1X2_usingDTable_internal':
> >> decompressor.c:(.text+0x2152): undefined reference to `__clzdi2'

haaaahh.... Not very nice, but that would work:

Vasily Gorbik (1):
  s390/boot: fix zstd build for -march=z900

 arch/s390/boot/compressed/Makefile  | 1 +
 arch/s390/boot/compressed/clz_ctz.c | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 arch/s390/boot/compressed/clz_ctz.c

-- 
2.25.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: decompressor.c:undefined reference to `__clzdi2'
@ 2021-07-29 13:29   ` Vasily Gorbik
  0 siblings, 0 replies; 8+ messages in thread
From: Vasily Gorbik @ 2021-07-29 13:29 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On Wed, Jul 28, 2021 at 01:27:54AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   ff1176468d368232b684f75e82563369208bc371
> commit: 7b034d9c1b08b3d06ad712283c1115a7fe39e354 s390/boot: add zstd support
> date:   6 weeks ago
> config: s390-randconfig-r026-20210727 (attached as .config)
...
>    s390-linux-ld: arch/s390/boot/compressed/decompressor.o: in function `HUF_decompress1X2_usingDTable_internal':
> >> decompressor.c:(.text+0x2152): undefined reference to `__clzdi2'

haaaahh.... Not very nice, but that would work:

Vasily Gorbik (1):
  s390/boot: fix zstd build for -march=z900

 arch/s390/boot/compressed/Makefile  | 1 +
 arch/s390/boot/compressed/clz_ctz.c | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 arch/s390/boot/compressed/clz_ctz.c

-- 
2.25.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] s390/boot: fix zstd build for -march=z900
  2021-07-29 13:29   ` Vasily Gorbik
@ 2021-07-29 13:29     ` Vasily Gorbik
  -1 siblings, 0 replies; 8+ messages in thread
From: Vasily Gorbik @ 2021-07-29 13:29 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Dimitri John Ledkov, kbuild-all, linux-kernel, kernel test robot

zstd decompression uses __builtin_clz() which fails back to __clzdi2()
when the kernel is built for older hardware like z900. This leads to
build failures like the following:
s390x-11.1.0-ld: /devel/src/kernel/arch/s390/boot/compressed/../../../../lib/zstd/bitstream.h:148: undefined reference to `__clzdi2'

Fix that by optionally including lib/clz_ctz.c into the decompressor.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 7b034d9c1b08 ("s390/boot: add zstd support")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
---
 arch/s390/boot/compressed/Makefile  | 1 +
 arch/s390/boot/compressed/clz_ctz.c | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 arch/s390/boot/compressed/clz_ctz.c

diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
index 660c799d875d..e30d3fdbbc78 100644
--- a/arch/s390/boot/compressed/Makefile
+++ b/arch/s390/boot/compressed/Makefile
@@ -11,6 +11,7 @@ UBSAN_SANITIZE := n
 KASAN_SANITIZE := n
 
 obj-y	:= $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
+obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o
 obj-all := $(obj-y) piggy.o syms.o
 targets	:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
diff --git a/arch/s390/boot/compressed/clz_ctz.c b/arch/s390/boot/compressed/clz_ctz.c
new file mode 100644
index 000000000000..c3ebf248596b
--- /dev/null
+++ b/arch/s390/boot/compressed/clz_ctz.c
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "../../../../lib/clz_ctz.c"
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] s390/boot: fix zstd build for -march=z900
@ 2021-07-29 13:29     ` Vasily Gorbik
  0 siblings, 0 replies; 8+ messages in thread
From: Vasily Gorbik @ 2021-07-29 13:29 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]

zstd decompression uses __builtin_clz() which fails back to __clzdi2()
when the kernel is built for older hardware like z900. This leads to
build failures like the following:
s390x-11.1.0-ld: /devel/src/kernel/arch/s390/boot/compressed/../../../../lib/zstd/bitstream.h:148: undefined reference to `__clzdi2'

Fix that by optionally including lib/clz_ctz.c into the decompressor.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 7b034d9c1b08 ("s390/boot: add zstd support")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
---
 arch/s390/boot/compressed/Makefile  | 1 +
 arch/s390/boot/compressed/clz_ctz.c | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 arch/s390/boot/compressed/clz_ctz.c

diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
index 660c799d875d..e30d3fdbbc78 100644
--- a/arch/s390/boot/compressed/Makefile
+++ b/arch/s390/boot/compressed/Makefile
@@ -11,6 +11,7 @@ UBSAN_SANITIZE := n
 KASAN_SANITIZE := n
 
 obj-y	:= $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
+obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o
 obj-all := $(obj-y) piggy.o syms.o
 targets	:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
diff --git a/arch/s390/boot/compressed/clz_ctz.c b/arch/s390/boot/compressed/clz_ctz.c
new file mode 100644
index 000000000000..c3ebf248596b
--- /dev/null
+++ b/arch/s390/boot/compressed/clz_ctz.c
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "../../../../lib/clz_ctz.c"
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] s390/boot: fix zstd build for -march=z900
  2021-07-29 13:29     ` Vasily Gorbik
@ 2021-07-29 14:42       ` Heiko Carstens
  -1 siblings, 0 replies; 8+ messages in thread
From: Heiko Carstens @ 2021-07-29 14:42 UTC (permalink / raw)
  To: Vasily Gorbik
  Cc: Dimitri John Ledkov, kbuild-all, linux-kernel, kernel test robot

On Thu, Jul 29, 2021 at 03:29:19PM +0200, Vasily Gorbik wrote:
> zstd decompression uses __builtin_clz() which fails back to __clzdi2()
> when the kernel is built for older hardware like z900. This leads to
> build failures like the following:
> s390x-11.1.0-ld: /devel/src/kernel/arch/s390/boot/compressed/../../../../lib/zstd/bitstream.h:148: undefined reference to `__clzdi2'
> 
> Fix that by optionally including lib/clz_ctz.c into the decompressor.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 7b034d9c1b08 ("s390/boot: add zstd support")
> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> ---
>  arch/s390/boot/compressed/Makefile  | 1 +
>  arch/s390/boot/compressed/clz_ctz.c | 2 ++
>  2 files changed, 3 insertions(+)
>  create mode 100644 arch/s390/boot/compressed/clz_ctz.c

Applied, thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] s390/boot: fix zstd build for -march=z900
@ 2021-07-29 14:42       ` Heiko Carstens
  0 siblings, 0 replies; 8+ messages in thread
From: Heiko Carstens @ 2021-07-29 14:42 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

On Thu, Jul 29, 2021 at 03:29:19PM +0200, Vasily Gorbik wrote:
> zstd decompression uses __builtin_clz() which fails back to __clzdi2()
> when the kernel is built for older hardware like z900. This leads to
> build failures like the following:
> s390x-11.1.0-ld: /devel/src/kernel/arch/s390/boot/compressed/../../../../lib/zstd/bitstream.h:148: undefined reference to `__clzdi2'
> 
> Fix that by optionally including lib/clz_ctz.c into the decompressor.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 7b034d9c1b08 ("s390/boot: add zstd support")
> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> ---
>  arch/s390/boot/compressed/Makefile  | 1 +
>  arch/s390/boot/compressed/clz_ctz.c | 2 ++
>  2 files changed, 3 insertions(+)
>  create mode 100644 arch/s390/boot/compressed/clz_ctz.c

Applied, thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-29 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 17:27 decompressor.c:undefined reference to `__clzdi2' kernel test robot
2021-07-27 17:27 ` kernel test robot
2021-07-29 13:29 ` Vasily Gorbik
2021-07-29 13:29   ` Vasily Gorbik
2021-07-29 13:29   ` [PATCH] s390/boot: fix zstd build for -march=z900 Vasily Gorbik
2021-07-29 13:29     ` Vasily Gorbik
2021-07-29 14:42     ` Heiko Carstens
2021-07-29 14:42       ` Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.