Re: ERROR: modpost: "__divsi3_table" [lib/lz4/lz4_compress.ko] undefined!

From: Randy Dunlap
Date: Wed Nov 23 2022 - 21:56:24 EST


[adding NIOS2 maintainer]

On 9/20/22 01:33, kernel test robot wrote:
> Hi Randy,
>
> First bad commit (maybe != root cause):

Yes, not related.

> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 521a547ced6477c54b4b0cc206000406c221b4d6
> commit: 81e005842d0b8167c059553a1c29c36d8a7a9329 media: isl7998x: select V4L2_FWNODE to fix build error
> date: 3 months ago
> config: nios2-buildonly-randconfig-r001-20220919
> compiler: nios2-linux-gcc (GCC) 12.1.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=81e005842d0b8167c059553a1c29c36d8a7a9329
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 81e005842d0b8167c059553a1c29c36d8a7a9329
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=nios2 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>, old ones prefixed by <<):
>
>>> ERROR: modpost: "__divsi3_table" [lib/lz4/lz4_compress.ko] undefined!

Due to -O3 optimization in lib/lz4/Makefile:

# SPDX-License-Identifier: GPL-2.0-only
ccflags-y += -O3

obj-$(CONFIG_LZ4_COMPRESS) += lz4_compress.o
obj-$(CONFIG_LZ4HC_COMPRESS) += lz4hc_compress.o
obj-$(CONFIG_LZ4_DECOMPRESS) += lz4_decompress.o

It builds fine without -O3.
--
~Randy