trunk.patch 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. diff --git a/Makefile.in b/Makefile.in
  2. index b4dcf6b..d7a5fca 100644
  3. --- a/Makefile.in
  4. +++ b/Makefile.in
  5. @@ -23,7 +23,7 @@ export KCONFIG_CONFIG
  6. ifeq ($(HAVE_DOT_CONFIG),y)
  7. -all: pregen libs
  8. +all: headers pregen libs
  9. libs: pregen
  10. # In this section, we need .config
  11. @@ -260,6 +260,7 @@ HEADERS_RM-$(UCLIBC_HAS_WCHAR) += wchar.h wctype.h
  12. HEADERS_RM-$(UCLIBC_HAS_WORDEXP) += wordexp.h
  13. HEADERS_RM-$(UCLIBC_HAS_XATTR) += sys/xattr.h
  14. HEADERS_RM-$(UCLIBC_HAS_XLOCALE) += xlocale.h
  15. +HEADERS_RM-$(UCLIBC_HAS_LOCALE) += bits/uClibc_ctype.h
  16. HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += sys/fsuid.h sys/inotify.h sys/perm.h \
  17. sys/personality.h \
  18. sys/prctl.h \
  19. diff --git a/extra/locale/Makefile b/extra/locale/Makefile
  20. index 11f362a..ff229e2 100644
  21. --- a/extra/locale/Makefile
  22. +++ b/extra/locale/Makefile
  23. @@ -4,10 +4,10 @@
  24. #
  25. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  26. #
  27. -
  28. top_srcdir=../../
  29. -top_builddir=../../
  30. +top_builddir=$(if $(O),$(O),../../)/
  31. +
  32. all: objs
  33. -include $(top_builddir)Rules.mak
  34. +include $(top_srcdir)Rules.mak
  35. include Makefile.in
  36. include $(top_srcdir)Makerules
  37. diff --git a/libc/sysdeps/linux/sparc/Makefile.arch b/libc/sysdeps/linux/sparc/Makefile.arch
  38. index 91c6e85..d0cae9f 100644
  39. --- a/libc/sysdeps/linux/sparc/Makefile.arch
  40. +++ b/libc/sysdeps/linux/sparc/Makefile.arch
  41. @@ -16,9 +16,15 @@ CSRC += sigaction.c
  42. SSRC += fork.S vfork.S
  43. endif
  44. +# check weather __LONG_DOUBLE_128__ is defined (long double support)
  45. +UCLIBC_SPARC_HAS_LONG_DOUBLE=$(shell if [ "x`$(CC) -E -dM -xc /dev/null 2>&1 | grep __LONG_DOUBLE_128__`" != "x" ]; then echo "y"; fi)
  46. +ifeq ($(UCLIBC_SPARC_HAS_LONG_DOUBLE),y)
  47. CSRC += $(foreach f, \
  48. q_div.c q_fle.c q_mul.c q_qtoll.c q_stoq.c \
  49. mp_clz_tab.c q_dtoq.c q_flt.c q_neg.c q_qtos.c q_sub.c \
  50. q_add.c q_feq.c q_fne.c q_qtod.c q_qtou.c q_ulltoq.c \
  51. q_cmp.c q_fge.c q_itoq.c q_qtoull.c q_util.c \
  52. q_cmpe.c q_fgt.c q_lltoq.c q_qtoi.c q_sqrt.c q_utoq.c, soft-fp/$(f))
  53. +else
  54. +CSRC += qp_ops.c
  55. +endif
  56. diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
  57. index 614cad1..db43634 100644
  58. --- a/libpthread/linuxthreads/pthread.c
  59. +++ b/libpthread/linuxthreads/pthread.c
  60. @@ -49,7 +49,7 @@ extern int _h_errno;
  61. /* We need the global/static resolver state here. */
  62. # include <resolv.h>
  63. # undef _res
  64. -extern struct __res_state _res;
  65. +extern struct __res_state *__resp;
  66. # endif
  67. #endif
  68. @@ -73,9 +73,6 @@ struct _pthread_descr_struct __pthread_initial_thread = {
  69. #if !(USE_TLS && HAVE___THREAD)
  70. .p_errnop = &_errno,
  71. .p_h_errnop = &_h_errno,
  72. -# if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
  73. - .p_resp = &_res,
  74. -# endif
  75. #endif
  76. .p_userstack = 1,
  77. .p_resume_count = __ATOMIC_INITIALIZER,
  78. @@ -544,14 +541,14 @@ static void pthread_initialize(void)
  79. THREAD_SETMEM (((pthread_descr) NULL), p_pid, __getpid());
  80. # if !defined HAVE___THREAD && (defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__)
  81. /* Likewise for the resolver state _res. */
  82. - THREAD_SETMEM (((pthread_descr) NULL), p_resp, &_res);
  83. + THREAD_SETMEM (((pthread_descr) NULL), p_resp, __resp);
  84. # endif
  85. #else
  86. /* Update the descriptor for the initial thread. */
  87. __pthread_initial_thread.p_pid = __getpid();
  88. # if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
  89. /* Likewise for the resolver state _res. */
  90. - __pthread_initial_thread.p_resp = &_res;
  91. + __pthread_initial_thread.p_resp = __resp;
  92. # endif
  93. #endif
  94. #if !__ASSUME_REALTIME_SIGNALS
  95. @@ -1129,7 +1126,7 @@ void __pthread_reset_main_thread(void)
  96. THREAD_SETMEM(self, p_errnop, &_errno);
  97. THREAD_SETMEM(self, p_h_errnop, &_h_errno);
  98. # if defined __UCLIBC_HAS_IPv4__ || defined __UCLIBC_HAS_IPV6__
  99. - THREAD_SETMEM(self, p_resp, &_res);
  100. + THREAD_SETMEM(self, p_resp, __resp);
  101. # endif
  102. #endif
  103. diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
  104. index 28dd3aa..71bebb0 100644
  105. --- a/libpthread/nptl/sem_open.c
  106. +++ b/libpthread/nptl/sem_open.c
  107. @@ -248,7 +248,7 @@ sem_open (const char *name, int oflag, ...)
  108. int fd;
  109. /* Determine where the shmfs is mounted. */
  110. - __pthread_once (&__namedsem_once, __where_is_shmfs);
  111. + INTUSE(__pthread_once) (&__namedsem_once, __where_is_shmfs);
  112. /* If we don't know the mount points there is nothing we can do. Ever. */
  113. if (mountpoint.dir == NULL)
  114. diff --git a/libpthread/nptl/sem_unlink.c b/libpthread/nptl/sem_unlink.c
  115. index beed02e..f3e7f1a 100644
  116. --- a/libpthread/nptl/sem_unlink.c
  117. +++ b/libpthread/nptl/sem_unlink.c
  118. @@ -33,7 +33,7 @@ sem_unlink (
  119. size_t namelen;
  120. /* Determine where the shmfs is mounted. */
  121. - __pthread_once (&__namedsem_once, __where_is_shmfs);
  122. + INTUSE(__pthread_once) (&__namedsem_once, __where_is_shmfs);
  123. /* If we don't know the mount points there is nothing we can do. Ever. */
  124. if (mountpoint.dir == NULL)
  125. diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in
  126. index 8ccf96d..fc0c6ac 100644
  127. --- a/libpthread/nptl/sysdeps/pthread/Makefile.in
  128. +++ b/libpthread/nptl/sysdeps/pthread/Makefile.in
  129. @@ -95,6 +95,10 @@ $(patsubst %,$(libpthread_pthread_OUT)/pt-%.oS,$(pthread-lc-fwd)): $(libpthread_
  130. $(compile.c)
  131. $(patsubst %,$(libpthread_pthread_OUT)/pt-%.o,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.o: $(libpthread_pthread_OUT)/pt-%.c
  132. $(compile.c)
  133. +ifeq ($(DOPIC),y)
  134. +$(patsubst %,$(libpthread_pthread_OUT)/pt-%.os,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.os: $(libpthread_pthread_OUT)/pt-%.c
  135. + $(compile.c)
  136. +endif
  137. objclean-y += CLEAN_libpthread/nptl/sysdeps/pthread
  138. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
  139. index 88ca01a..102c0da 100644
  140. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
  141. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
  142. @@ -7,16 +7,20 @@
  143. libpthread_linux_arch_SSRC = pt-vfork.S clone.S
  144. libpthread_linux_arch_CSRC = pthread_once.c lowlevellock.c \
  145. - pthread_barrier_init.c pthread_barrier_wait.c pthread_barrier_destroy.c
  146. + pthread_barrier_init.c pthread_barrier_wait.c pthread_barrier_destroy.c \
  147. + pt-__syscall_error.c
  148. libc_linux_arch_CSRC = fork.c libc-lowlevellock.c
  149. libc_linux_arch_SSRC = clone.S vfork.S
  150. +librt_linux_arch_CSRC = pt-__syscall_error.c
  151. +
  152. ASFLAGS += -DUSE___THREAD
  153. ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  154. CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
  155. CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
  156. +CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  157. ASFLAGS-clone.S = -D_LIBC_REENTRANT
  158. ASFLAGS-vfork.S = -D_LIBC_REENTRANT
  159. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-__syscall_error.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-__syscall_error.c
  160. new file mode 100644
  161. index 0000000..872e4ef
  162. --- /dev/null
  163. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-__syscall_error.c
  164. @@ -0,0 +1 @@
  165. +#include <../../../../../../../libc/sysdeps/linux/sparc/__syscall_error.c>
  166. diff --git a/libpthread/nptl_db/Makefile.in b/libpthread/nptl_db/Makefile.in
  167. index 644ec55..a3fc1cd 100644
  168. --- a/libpthread/nptl_db/Makefile.in
  169. +++ b/libpthread/nptl_db/Makefile.in
  170. @@ -12,8 +12,7 @@ CFLAGS-nptl_db := -DLIBPTHREAD_SO="\"libpthread.so.$(ABI_VERSION)\""
  171. CFLAGS-nptl_db += -I$(top_srcdir)libpthread/nptl -D_GNU_SOURCE
  172. CFLAGS-nptl_db += -DIS_IN_libthread_db=1 -DNOT_IN_libc -std=gnu99 -I$(top_srcdir)ldso/include
  173. -LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols
  174. -
  175. +LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) $(if $(call check_ld,--warn-unresolved-symbols),-Wl$(comma)--warn-unresolved-symbols)
  176. LIBS-libthread_db.so := $(LIBS)
  177. libthread_db_FULL_NAME := libthread_db-$(VERSION).so