From c27b470d396177e70af5fad3e70e7634092822c5 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 11 Sep 2023 18:19:18 +0800 Subject: [PATCH] Fix error: implicit declaration of function 'arc4random'; did you mean 'random'? [-Werror=implicit-function-declaration] Signed-off-by: Xiang Xiao --- crypto/CMakeLists.txt | 4 +++- crypto/Makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 68073b4836..744cfe8099 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -53,7 +53,9 @@ if(CONFIG_CRYPTO) list(APPEND SRCS gmac.c) list(APPEND SRCS cmac.c) list(APPEND SRCS hmac.c) - list(APPEND SRCS idgen.c) + if(CONFIG_CRYPTO_RANDOM_POOL) + list(APPEND SRCS idgen.c) + endif() list(APPEND SRCS key_wrap.c) list(APPEND SRCS siphash.c) list(APPEND SRCS hmac_buff.c) diff --git a/crypto/Makefile b/crypto/Makefile index b97e2f6b89..f666175b38 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -57,7 +57,9 @@ CRYPTO_CSRCS += sha2.c CRYPTO_CSRCS += gmac.c CRYPTO_CSRCS += cmac.c CRYPTO_CSRCS += hmac.c -CRYPTO_CSRCS += idgen.c +ifeq ($(CONFIG_CRYPTO_RANDOM_POOL),y) + CRYPTO_CSRCS += idgen.c +endif CRYPTO_CSRCS += key_wrap.c CRYPTO_CSRCS += siphash.c CRYPTO_CSRCS += hmac_buff.c