From 80a329157aa18d1313c315b10cdf79c360be5837 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Sat, 29 Apr 2023 15:20:46 +0100 Subject: [PATCH] prevent hard dependency on findfp --- .../patches/newlib-4.3.0.20230120.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dkarm-eabi/patches/newlib-4.3.0.20230120.patch b/dkarm-eabi/patches/newlib-4.3.0.20230120.patch index dd06ef2..b3b303e 100644 --- a/dkarm-eabi/patches/newlib-4.3.0.20230120.patch +++ b/dkarm-eabi/patches/newlib-4.3.0.20230120.patch @@ -11983,6 +11983,27 @@ index 9812add76..8410f2633 100644 %D%/utoa.c \ %D%/wcstod.c \ %D%/wcstoimax.c \ +diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c +index 9b7bd518b..f0e33bbc1 100644 +--- a/newlib/libc/stdlib/exit.c ++++ b/newlib/libc/stdlib/exit.c +@@ -45,6 +45,16 @@ Supporting OS subroutines required: <<_exit>>. + #include + #include "atexit.h" + ++// exit calls this handler; avoid a hard dependency on findfp by providing a weak global ++void (*__stdio_exit_handler)(void) __attribute__((weak)); ++ ++// exit calls this function; avoid a hard dependency on atexit by providing a simple weak implementation ++__attribute__((weak)) void __call_exitprocs(int rc, void* dso) ++{ ++ extern void __libc_fini_array(void); ++ __libc_fini_array(); ++} ++ + /* + * Exit, flushing stdio buffers if necessary. + */ diff --git a/newlib/libc/stdlib/mlock.c b/newlib/libc/stdlib/mlock.c index 23aa10173..ba88eb9fb 100644 --- a/newlib/libc/stdlib/mlock.c