uClibc-0.9.31.1-linuxthreads-errno-fix.patch 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/misc/internals/__uClibc_main.c | 2 --
  16. libc/sysdeps/linux/common/bits/errno.h | 1 -
  17. libc/sysdeps/linux/common/bits/uClibc_errno.h | 3 ---
  18. 6 files changed, 0 insertions(+), 11 deletions(-)
  19. diff --git a/include/netdb.h b/include/netdb.h
  20. index 9d3807d..ac411ab 100644
  21. --- a/include/netdb.h
  22. +++ b/include/netdb.h
  23. @@ -59,7 +59,6 @@ __BEGIN_DECLS
  24. /* Function to get address of global `h_errno' variable. */
  25. extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
  26. -libc_hidden_proto(__h_errno_location)
  27. /* Macros for accessing h_errno from inside libc. */
  28. #ifdef _LIBC
  29. diff --git a/libc/misc/internals/__errno_location.c b/libc/misc/internals/__errno_location.c
  30. index 487a9c2..0620860 100644
  31. --- a/libc/misc/internals/__errno_location.c
  32. +++ b/libc/misc/internals/__errno_location.c
  33. @@ -11,6 +11,3 @@ int * weak_const_function __errno_location (void)
  34. {
  35. return &errno;
  36. }
  37. -#ifdef IS_IN_libc /* not really need, only to keep in sync w/ libc_hidden_proto */
  38. -libc_hidden_weak(__errno_location)
  39. -#endif
  40. diff --git a/libc/misc/internals/__h_errno_location.c b/libc/misc/internals/__h_errno_location.c
  41. index 213d398..235df4e 100644
  42. --- a/libc/misc/internals/__h_errno_location.c
  43. +++ b/libc/misc/internals/__h_errno_location.c
  44. @@ -10,4 +10,3 @@ int * weak_const_function __h_errno_location (void)
  45. {
  46. return &h_errno;
  47. }
  48. -libc_hidden_weak(__h_errno_location)
  49. diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
  50. index 6e520fa..f4a9ebb 100644
  51. --- a/libc/misc/internals/__uClibc_main.c
  52. +++ b/libc/misc/internals/__uClibc_main.c
  53. @@ -64,9 +64,7 @@ void internal_function _dl_aux_init (ElfW(auxv_t) *av);
  54. * Prototypes.
  55. */
  56. extern int *weak_const_function __errno_location(void);
  57. -libc_hidden_proto(__errno_location)
  58. extern int *weak_const_function __h_errno_location(void);
  59. -libc_hidden_proto(__h_errno_location)
  60. extern void weak_function _stdio_init(void) attribute_hidden;
  61. #ifdef __UCLIBC_HAS_LOCALE__
  62. diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h
  63. index 0bf6354..de9688a 100644
  64. --- a/libc/sysdeps/linux/common/bits/errno.h
  65. +++ b/libc/sysdeps/linux/common/bits/errno.h
  66. @@ -43,7 +43,6 @@
  67. # ifndef __ASSEMBLER__
  68. /* Function to get address of global `errno' variable. */
  69. extern int *__errno_location (void) __THROW __attribute__ ((__const__));
  70. -libc_hidden_proto(__errno_location)
  71. # ifdef __UCLIBC_HAS_THREADS__
  72. /* When using threads, errno is a per-thread value. */
  73. diff --git a/libc/sysdeps/linux/common/bits/uClibc_errno.h b/libc/sysdeps/linux/common/bits/uClibc_errno.h
  74. index 9c15618..79eb7e6 100644
  75. --- a/libc/sysdeps/linux/common/bits/uClibc_errno.h
  76. +++ b/libc/sysdeps/linux/common/bits/uClibc_errno.h
  77. @@ -33,9 +33,6 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__))
  78. ;
  79. # if defined __UCLIBC_HAS_THREADS__
  80. # include <tls.h>
  81. -# if defined USE___THREAD && USE___THREAD
  82. -libc_hidden_proto(__errno_location)
  83. -# endif
  84. # endif
  85. #endif /* !__ASSEMBLER__ */
  86. --
  87. 1.7.1