0002-lib-utils-printf-Exclude-__GI_vsnprintf-alias-for-gcc-9-and-above.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. From 7bbde67cb2dc52c04bd7020689a1227bddfa1b06 Mon Sep 17 00:00:00 2001
  2. From: Damien George <damien.p.george@gmail.com>
  3. Date: Wed, 6 Feb 2019 01:12:51 +1100
  4. Subject: [PATCH] lib/utils/printf: Exclude __GI_vsnprintf alias for gcc 9 and
  5. above.
  6. See issue #4457.
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. [Retrieved from:
  9. https://github.com/micropython/micropython/commit/7bbde67cb2dc52c04bd7020689a1227bddfa1b06]
  10. ---
  11. lib/utils/printf.c | 4 +++-
  12. 1 file changed, 3 insertions(+), 1 deletion(-)
  13. diff --git a/lib/utils/printf.c b/lib/utils/printf.c
  14. index 1ceeea39ff..0c21fc4c0a 100644
  15. --- a/lib/utils/printf.c
  16. +++ b/lib/utils/printf.c
  17. @@ -99,9 +99,11 @@ STATIC void strn_print_strn(void *data, const char *str, size_t len) {
  18. strn_print_env->remain -= len;
  19. }
  20. -#if defined(__GNUC__) && !defined(__clang__)
  21. +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9
  22. // uClibc requires this alias to be defined, or there may be link errors
  23. // when linkings against it statically.
  24. +// GCC 9 gives a warning about missing attributes so it's excluded until
  25. +// uClibc+GCC9 support is needed.
  26. int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf")));
  27. #endif