Re: arch/riscv/kernel/alternative.c:198:6: error: use of undeclared identifier '__vdso_alternatives_start_offset'; did you mean '__vdso_alternatives_start_cfi_offset'?

From: Thomas Weißschuh

Date: Tue Oct 13 2026 - 14:42:28 EST


On Tue, Oct 13, 2026 at 05:01:07PM +0200, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
> commit: 63aecaba41a4b2593697f208e91bf542248ec4f8 riscv: alternative: Use the statically extracted vDSO section offsets
> date: 10 weeks ago
> config: riscv-randconfig-r2104-20261013 (https://download.01.org/0day-ci/archive/20261013/202610131613.BpOi6VPp-lkp@xxxxxxxxx/config)
> compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project ce2a4984a3f43327a2b7c40baa74907bc10eb899)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261013/202610131613.BpOi6VPp-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
> | Fixes: 63aecaba41a4 ("riscv: alternative: Use the statically extracted vDSO section offsets")
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202610131613.BpOi6VPp-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> >> arch/riscv/kernel/alternative.c:198:6: error: use of undeclared identifier '__vdso_alternatives_start_offset'; did you mean '__vdso_alternatives_start_cfi_offset'?
> 198 | __vdso_alternatives_start_offset,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | __vdso_alternatives_start_cfi_offset
> arch/riscv/include/asm/vdso.h:29:15: note: '__vdso_alternatives_start_cfi_offset' declared here
> 29 | extern size_t __vdso_alternatives_start_cfi_offset, __vdso_alternatives_end_cfi_offset;
> | ^
> >> arch/riscv/kernel/alternative.c:199:6: error: use of undeclared identifier '__vdso_alternatives_end_offset'; did you mean '__vdso_alternatives_end_cfi_offset'?
> 199 | __vdso_alternatives_end_offset);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | __vdso_alternatives_end_cfi_offset
> arch/riscv/include/asm/vdso.h:29:53: note: '__vdso_alternatives_end_cfi_offset' declared here
> 29 | extern size_t __vdso_alternatives_start_cfi_offset, __vdso_alternatives_end_cfi_offset;
> | ^
> 2 errors generated.

This looks to be a only a follow-up error.
The real issue is https://lore.kernel.org/all/20261009214501.GA905361@ax162/.
Which leads to no vDSO being generated and an empty vdso-offsets.h.
In addition to fixing the linked issue, we should also make sure that the build
properly aborts if one of the intermediate steps fails.

> vim +198 arch/riscv/kernel/alternative.c
>
> 186
> 187 void __init apply_boot_alternatives(void)
> 188 {
> 189 /* If called on non-boot cpu things could go wrong */
> 190 WARN_ON(smp_processor_id() != 0);
> 191
> 192 _apply_alternatives((struct alt_entry *)__alt_start,
> 193 (struct alt_entry *)__alt_end,
> 194 RISCV_ALTERNATIVES_BOOT);
> 195
> 196 if (IS_ENABLED(CONFIG_MMU))
> 197 apply_vdso_alternatives(vdso_start,
> > 198 __vdso_alternatives_start_offset,
> > 199 __vdso_alternatives_end_offset);
> 200
> 201 if (IS_ENABLED(CONFIG_RISCV_USER_CFI))
> 202 apply_vdso_alternatives(vdso_cfi_start,
> 203 __vdso_alternatives_start_cfi_offset,
> 204 __vdso_alternatives_end_cfi_offset);
> 205 }
> 206
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki