0001-uclibc-backtrace.patch 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. [PATCH] fix build on uClibc without UCLIBC_HAS_BACKTRACE
  2. Backtrace support is only used for logging on signal errors, which
  3. isn't really critical, so simply remove backtrace info if not
  4. available in uClibc.
  5. NOTE: based on patch from Peter Korsgaard <jacmet@sunsite.dk>
  6. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
  7. ---
  8. --- ofono-1.7.orig/src/log.c
  9. +++ ofono-1.7/src/log.c
  10. @@ -30,7 +30,8 @@
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include <syslog.h>
  14. -#ifdef __GLIBC__
  15. +#if defined(__GLIBC__) && !(defined(__UCLIBC__) && !defined (__UCLIBC_HAS_BACKTRACE__))
  16. +#define HAVE_BACKTRACE
  17. #include <execinfo.h>
  18. #endif
  19. #include <dlfcn.h>
  20. @@ -115,7 +116,7 @@
  21. va_end(ap);
  22. }
  23. -#ifdef __GLIBC__
  24. +#ifdef HAVE_BACKTRACE
  25. static void print_backtrace(unsigned int offset)
  26. {
  27. void *frames[99];
  28. @@ -312,7 +313,7 @@
  29. if (detach == FALSE)
  30. option |= LOG_PERROR;
  31. -#ifdef __GLIBC__
  32. +#ifdef HAVE_BACKTRACE
  33. signal_setup(signal_handler);
  34. #endif
  35. @@ -329,7 +330,7 @@
  36. closelog();
  37. -#ifdef __GLIBC__
  38. +#ifdef HAVE_BACKTRACE
  39. signal_setup(SIG_DFL);
  40. #endif