Re: ld.lld: error: Function Import: link error: linking module flags 'Code Model': IDs have conflicting values in 'vmlinux.a(init.o at 726002)' and 'vmlinux.a(security.o at 766562)'

From: Nam Cao
Date: Thu Aug 14 2025 - 03:19:31 EST


On Thu, Aug 14, 2025 at 08:13:44AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: dfc0f6373094dd88e1eaf76c44f2ff01b65db851
> commit: 890ba5be6335dbbbc99af14ea007befb5f83f174 Revert "riscv: Define TASK_SIZE_MAX for __access_ok()"
> date: 7 weeks ago
> config: riscv-randconfig-r064-20250813 (https://download.01.org/0day-ci/archive/20250814/202508140806.Q4rNoCdr-lkp@xxxxxxxxx/config)
> compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508140806.Q4rNoCdr-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202508140806.Q4rNoCdr-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> >> ld.lld: error: Function Import: link error: linking module flags 'Code Model': IDs have conflicting values in 'vmlinux.a(init.o at 726002)' and 'vmlinux.a(security.o at 766562)'

Known issue, being fixed by:
https://lore.kernel.org/lkml/20250710-riscv-restrict-lto-to-medany-v1-1-b1dac9871ecf@xxxxxxxxxx/#t

Nam