Browse Source

Merge branch '1.0' of git+ssh://uclibc-ng.org/git/uclibc-ng into 1.0

Waldemar Brodkorb 10 years ago
parent
commit
2342454714
3 changed files with 10 additions and 6 deletions
  1. 2 1
      Makefile.in
  2. 5 2
      libpthread/nptl/sysdeps/arc/tls.h
  3. 3 3
      test/tls/tls-macros.h

+ 2 - 1
Makefile.in

@@ -183,11 +183,12 @@ menuconfig-clean-y: HEADERCLEAN_config
 headers-y += $(target-headers-sysdep)
 
 headers: $(top_builddir)include/bits/uClibc_config.h | subdirs
+	$(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
+
 subdirs: $(addprefix $(top_builddir),$(subdirs))
 
 $(pregen-headers-y): $(headers_dep)
 pregen: headers $(pregen-headers-y) $(headers_dep)
-	$(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
 
 $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh | $(top_builddir)include/bits
 	@$(disp_gen)

+ 5 - 2
libpthread/nptl/sysdeps/arc/tls.h

@@ -104,8 +104,11 @@ typedef struct
    operation can cause a failure 'errno' must not be touched.  */
 # define TLS_INIT_TP(tcbp, secondcall)          \
   ({                                            \
-        __builtin_set_thread_pointer(tcbp);     \
-        NULL;                                   \
+	long result_var;			\
+	__builtin_set_thread_pointer(tcbp);     \
+	result_var = INTERNAL_SYSCALL (arc_settls, err, 1, (tcbp));	\
+	INTERNAL_SYSCALL_ERROR_P (result_var, err)			\
+	? "unknown error" : NULL;		\
    })
 
 /* Return the address of the dtv for the current thread.

+ 3 - 3
test/tls/tls-macros.h

@@ -900,9 +900,9 @@ register void *__gp __asm__("$29");
 
 #define TLS_LD(x)							\
   ({ int *__l;								\
-     __asm__ ("movi  a8, " #x "@TLSFUNC\n\t"				\
-	  "movi a10, " #x "@TLSARG\n\t"					\
-	  "callx8.tls a8, " #x "@TLSCALL\n\t"				\
+     __asm__ ("movi  a8, _TLS_MODULE_BASE_@TLSFUNC\n\t"			\
+	  "movi a10, _TLS_MODULE_BASE_@TLSARG\n\t"			\
+	  "callx8.tls a8, _TLS_MODULE_BASE_@TLSCALL\n\t"		\
 	  "movi %0, " #x "@TPOFF\n\t"					\
 	  "add %0, %0, a10\n\t"						\
 	  : "=r" (__l)							\