[Bug 5618] uClibc build is broken: undefined reference to `__emutls_get_address' in function `__syscall_error'

bugzilla at busybox.net bugzilla at busybox.net
Tue Mar 5 19:56:28 UTC 2013


https://bugs.busybox.net/show_bug.cgi?id=5618

--- Comment #5 from Douglas <dougmencken at gmail.com> 2013-03-05 19:57:10 UTC ---
To re-produce this issue, you need to build uClibc under uClibc system natively
(with native toolchain).

I found that "Using thread local storage requires **manually linking** to TLS
emutls, via -lgcc_s (-lgcc_s.so.1)."

$ readelf -h -d -s /usr/lib/libgcc_s.so.1 | grep "emutls_get_addres"
   157: 0001277c   452 FUNC    GLOBAL DEFAULT    9
__emutls_get_address@@GCC_4.3.0
   376: 0001277c   452 FUNC    GLOBAL DEFAULT    9 __emutls_get_address

Editing Rules.mak as the following

--- evil/Rules.mak
+++ good/Rules.mak
@@ -720,6 +720,8 @@ else
 DOMULTI:=n
 endif

+LDFLAGS += -lgcc_s
+
 ifneq ($(strip $(UCLIBC_EXTRA_LDFLAGS)),"")
 LDFLAGS += $(call qstrip,$(UCLIBC_EXTRA_LDFLAGS))
 endif

makes me succeed a little further. Now I got:

  AS libpthread/nptl/sysdeps/pthread/pt-crtn.o
  LD libpthread-0.9.34-git.so
libpthread/nptl/libpthread_so.a(pthread_mutex_cond_lock.oS): In function
`__pthread_mutex_cond_lock_full':
(.text.unlikely+0x2bc): undefined reference to `__emutls_get_address'

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list