[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <32ba635c-4588-4ea3-bd95-c55a33804e99@www.fastmail.com>
Date: Mon, 06 Dec 2021 18:02:33 +0100
From: "Sven Peter" <sven@...npeter.dev>
To: "kernel test robot" <lkp@...el.com>, linux-i2c@...r.kernel.org
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
"Wolfram Sang" <wsa-dev@...g-engineering.com>,
"Arnd Bergmann" <arnd@...db.de>,
"Hector Martin" <marcan@...can.st>,
"Alyssa Rosenzweig" <alyssa@...enzweig.io>
Subject: Re: powerpc64-linux-ld: drivers/i2c/busses/i2c-pasemi-core.o:undefined
reference to `__this_module'
On Mon, Dec 6, 2021, at 11:10, kernel test robot wrote:
> tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> head: 0fcfb00b28c0b7884635dacf38e46d60bf3d4eb1
> commit: d88ae2932df0e670610cb741fec442ad12466c03 i2c: pasemi: Add Apple
> platform driver
> date: 8 weeks ago
> config: powerpc64-randconfig-r023-20211206
> (https://download.01.org/0day-ci/archive/20211206/202112061809.XT99aPrf-lkp@intel.com/config)
> compiler: powerpc64-linux-gcc (GCC) 11.2.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=d88ae2932df0e670610cb741fec442ad12466c03
> git remote add linus
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout d88ae2932df0e670610cb741fec442ad12466c03
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross
> O=build_dir ARCH=powerpc SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
>
> All error/warnings (new ones prefixed by >>):
>
>>> powerpc64-linux-ld: warning: orphan section `.stubs' from `drivers/i2c/busses/i2c-pasemi-core.o' being placed in section `.stubs'
>>> powerpc64-linux-ld: drivers/i2c/busses/i2c-pasemi-core.o:(.toc+0x0): undefined reference to `__this_module'
This seems to be triggered by compiling one of {pci,platform} as a module and the
other one as built-in. That setup can only happen with COMPILE_TEST since -pci
is otherwise only compiled for powerpc and -platform for arm64.
-core.c is only built once with THIS_MODULE expanding to __this_module. That will
fail when linking the built-in driver where THIS_MODULE should've been NULL instead.
The most simple fix (that also has no chance of breaking anything) is probably to
just move
smbus->adapter.owner = THIS_MODULE;
from core to both apple.c and pci.c. I'll prepare a patch later this week.
Sven
Powered by blists - more mailing lists