arm64: pointer_auth.h:40:3: error: implicit declaration of function âget_random_bytesâ; did you mean âget_random_onceâ?

From: Naresh Kamboju
Date: Thu Jul 30 2020 - 06:56:06 EST


Linus master branch failed to build the arm64 architecture due to
below error and warnings.

kernel config:
https://builds.tuxbuild.com/Dp3s1p4uYnGpImQwCvhzEw/kernel.config

git_repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
target_arch: arm64
toolchain: gcc-9
git_short_log:
83bdc7275e62 (\random32: remove net_rand_state from the latent entropy
gcc plugin\)
git_describe: v5.8-rc7-40-g83bdc7275e62

make -sk KBUILD_BUILD_USER=TuxBuild -C/linux -j16 ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu- HOSTCC=gcc CC="sccache
aarch64-linux-gnu-gcc" O=build Image
#
In file included from ../arch/arm64/include/asm/smp.h:33,
from ../include/linux/smp.h:82,
from ../include/linux/percpu.h:7,
from ../include/linux/random.h:14,
from ../arch/arm64/kernel/pointer_auth.c:5:
../arch/arm64/include/asm/pointer_auth.h: In function âptrauth_keys_init_userâ:
../arch/arm64/include/asm/pointer_auth.h:40:3: error: implicit
declaration of function âget_random_bytesâ; did you mean
âget_random_onceâ? [-Werror=implicit-function-declaration]
40 | get_random_bytes(&keys->apia, sizeof(keys->apia));
| ^~~~~~~~~~~~~~~~
| get_random_once
In file included from ../arch/arm64/kernel/pointer_auth.c:5:
../include/linux/random.h: At top level:
../include/linux/random.h:41:13: warning: conflicting types for
âget_random_bytesâ
41 | extern void get_random_bytes(void *buf, int nbytes);
| ^~~~~~~~~~~~~~~~
In file included from ../arch/arm64/include/asm/smp.h:33,
from ../include/linux/smp.h:82,
from ../include/linux/percpu.h:7,
from ../include/linux/random.h:14,
from ../arch/arm64/kernel/pointer_auth.c:5:
../arch/arm64/include/asm/pointer_auth.h:40:3: note: previous implicit
declaration of âget_random_bytesâ was here
40 | get_random_bytes(&keys->apia, sizeof(keys->apia));
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

build log link,
https://gitlab.com/Linaro/lkft/kernel-runs/-/jobs/662908458

--
Linaro LKFT
https://lkft.linaro.org