Re: kernel/bpf/core.c:1913:3: error: call to undeclared function 'barrier_nospec'; ISO C99 and later do not support implicit function declarations

From: Viresh Kumar
Date: Wed Feb 22 2023 - 03:30:15 EST


On Wed, Feb 22, 2023 at 11:12 AM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 5b7c4cabbb65f5c469464da6c5f614cbd7f730f2
> commit: 74e19ef0ff8061ef55957c3abd71614ef0f42f47 uaccess: Add speculation barrier to copy_from_user()
> date: 6 hours ago
> config: hexagon-buildonly-randconfig-r005-20230222 (https://download.01.org/0day-ci/archive/20230222/202302221228.E0rmVamR-lkp@xxxxxxxxx/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project db89896bbbd2251fff457699635acbbedeead27f)

> >> kernel/bpf/core.c:1913:3: error: call to undeclared function 'barrier_nospec'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> barrier_nospec();
> ^

I got the same one for arm64, the following patch must fix this.

https://lore.kernel.org/all/9c476aa64c9588205817833dbaa622f87c0e0081.1677051600.git.viresh.kumar@xxxxxxxxxx/