uClibc-0.9.32.1-linuxthreads-errno-fix.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From af8b2d71ce37b9d4d24ddbc755cdea68de02949a Mon Sep 17 00:00:00 2001
  2. From: Peter Korsgaard <jacmet@sunsite.dk>
  3. Date: Mon, 5 Jul 2010 14:08:17 +0200
  4. Subject: [PATCH] don't make __errno_location / __h_errno_location hidden
  5. Closes #2089 (https://bugs.busybox.net/show_bug.cgi?id=2089)
  6. __errno_location / __h_errno_location access has to go through the PLT
  7. like malloc/free, so the linuxthread variants gets used instead when
  8. compiling with -pthread.
  9. Based on http://github.com/mat-c/uClibc/commit/328d392c54aa5dc2b8e7f398a419087de497de2b
  10. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  11. ---
  12. include/netdb.h | 1 -
  13. libc/misc/internals/__errno_location.c | 3 ---
  14. libc/misc/internals/__h_errno_location.c | 1 -
  15. libc/sysdeps/linux/common/bits/errno.h | 1 -
  16. 6 files changed, 0 insertions(+), 11 deletions(-)
  17. diff --git a/include/netdb.h b/include/netdb.h
  18. index 9d3807d..ac411ab 100644
  19. --- a/include/netdb.h
  20. +++ b/include/netdb.h
  21. @@ -59,7 +59,6 @@ __BEGIN_DECLS
  22. /* Function to get address of global `h_errno' variable. */
  23. extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
  24. -libc_hidden_proto(__h_errno_location)
  25. /* Macros for accessing h_errno from inside libc. */
  26. #ifdef _LIBC
  27. diff --git a/libc/misc/internals/__errno_location.c b/libc/misc/internals/__errno_location.c
  28. index 487a9c2..0620860 100644
  29. --- a/libc/misc/internals/__errno_location.c
  30. +++ b/libc/misc/internals/__errno_location.c
  31. @@ -15,6 +15,3 @@ int * weak_const_function __errno_location (void)
  32. {
  33. return &errno;
  34. }
  35. -#ifdef IS_IN_libc /* not really need, only to keep in sync w/ libc_hidden_proto */
  36. -libc_hidden_weak(__errno_location)
  37. -#endif
  38. diff --git a/libc/misc/internals/__h_errno_location.c b/libc/misc/internals/__h_errno_location.c
  39. index 213d398..235df4e 100644
  40. --- a/libc/misc/internals/__h_errno_location.c
  41. +++ b/libc/misc/internals/__h_errno_location.c
  42. @@ -10,4 +10,3 @@ int * weak_const_function __h_errno_location (void)
  43. {
  44. return &h_errno;
  45. }
  46. -libc_hidden_weak(__h_errno_location)
  47. diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
  48. index 6e520fa..f4a9ebb 100644
  49. --- a/libc/sysdeps/linux/common/bits/errno.h
  50. +++ b/libc/sysdeps/linux/common/bits/errno.h
  51. @@ -43,7 +43,6 @@
  52. # ifndef __ASSEMBLER__
  53. /* Function to get address of global `errno' variable. */
  54. extern int *__errno_location (void) __THROW __attribute__ ((__const__));
  55. -libc_hidden_proto(__errno_location)
  56. # ifdef __UCLIBC_HAS_THREADS__
  57. /* When using threads, errno is a per-thread value. */
  58. --
  59. 1.7.1