Skip to contentSkip to conversation

ld.lld: error: undefined symbol: __bad_ndelay

DISCUSSION kernel test robot 2 participants 2 messages Mar 31 – Apr 8

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d0c3bcd5b8976159d835a897254048e078f447e6
commit: 4434072a893e4864519c167947083ff3e4cc2d95 iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
date:   3 months ago
config: x86_64-buildonly-randconfig-001-20260331 (https://download.01.org/0day-ci/archive/20260331/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260331/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: __bad_ndelay
   >>> referenced by delay.h:78 (include/asm-generic/delay.h:78)
   >>>               vmlinux.o:(nxp_sar_adc_probe)
   >>> referenced by delay.h:78 (include/asm-generic/delay.h:78)
   >>>               vmlinux.o:(nxp_sar_adc_read_raw)
   >>> referenced by delay.h:78 (include/asm-generic/delay.h:78)
   >>>               vmlinux.o:(nxp_sar_adc_read_raw)
   >>> referenced 2 more times
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 8 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d0c3bcd5b8976159d835a897254048e078f447e6
commit: 4434072a893e4864519c167947083ff3e4cc2d95 iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
date:   3 months ago
config: x86_64-buildonly-randconfig-001-20260331 (https://download.01.org/0day-ci/archive/20260331/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260331/[email protected]/reproduce)
Quoted 4 lines

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

My understanding that in some interesting cases (CONFIG_COMMON_CLK=n) this leads to division by 0 that compiler prevents by saturating the value. Note, I haven't checked the real assembly for that, just a speculation based on the code reading and kernel configuration (*).

With saturated value it's obviously is over any given threshold which is currently 20000.

*Yes, seems the specifications says that this is UB (as unspecified) and compiler may do whatever it wants in such a case. Here it seems does the saturation (which is logically okay as 0 is compile-time constant).
Related: https://github.com/llvm/llvm-project/issues/136679.

Quoted 10 lines

All errors (new ones prefixed by >>):

Quoted 8 lines
Quoted 8 lines

ld.lld: error: undefined symbol: __bad_ndelay

Quoted 7 lines

referenced by delay.h:78 (include/asm-generic/delay.h:78)
vmlinux.o:(nxp_sar_adc_probe)
referenced by delay.h:78 (include/asm-generic/delay.h:78)
vmlinux.o:(nxp_sar_adc_read_raw)
referenced by delay.h:78 (include/asm-generic/delay.h:78)
vmlinux.o:(nxp_sar_adc_read_raw)
referenced 2 more times

Signature · 2 lines
With Best Regards,
Andy Shevchenko