From 2e2651f0874af143427b9d2bf6d95e36ddcf6ddd Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Tue, 22 Jul 2025 10:39:07 -0500 Subject: [PATCH] add default implementation of `_get_entropy()` that returns -1 to avoid linker warning (#2578) --- src/rp2_common/pico_clib_interface/newlib_interface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rp2_common/pico_clib_interface/newlib_interface.c b/src/rp2_common/pico_clib_interface/newlib_interface.c index 8925e546..61adeb48 100644 --- a/src/rp2_common/pico_clib_interface/newlib_interface.c +++ b/src/rp2_common/pico_clib_interface/newlib_interface.c @@ -152,6 +152,11 @@ int __attribute__((weak)) _isatty(int fd) { return fd == STDIO_HANDLE_STDIN || fd == STDIO_HANDLE_STDOUT || fd == STDIO_HANDLE_STDERR; } +int __attribute__((weak)) _getentropy (__unused void *buffer, __unused size_t length) { + // note we don't hook this up as it isn't clear if/where it is used, and we don't particularly + // want to pull in pico_rand. the user can supply their own strong implementation if they need it! + return -1; +} // exit is not useful... no desire to pull in __call_exitprocs void exit(int status) { _exit(status);