[SVN-Commit] r607 - branches/experimental/www/firefox-aurora

Test Rat ttsestt at gmail.com
Tue Aug 23 13:50:46 UTC 2011


Florian Smeets <flo at freebsd.org> writes:
> On 21.08.2011 22:37, Test Rat wrote:
>> Florian Smeets<flo at FreeBSD.org>  writes:
>>>>>>> Author: flo
>>>>>>> Date: Wed Aug  3 23:03:27 2011
>>>>>>> New Revision: 607
>>>>>>>
>>>>>>> Log:
>>>>>>> update to 7.0a2-20110803 (non debug builds are still broken)
[...]
>>> Interesting! libc built with clang makes it work.
>>
>> Can you try with default TLS model? It's the one used clang-built libc
>> and by jemalloc bundled (for linux/android) with mozilla.
>
> Yes, that does work, too.

I give up, no clue how to properly access a TLS variable used by the
standalone glue in dlopen'd libxul.so. One workraound is to use dummy
assignment before initialization, another is to LD_PRELOAD the library.

  $ nm -A xpcom/threads/*.o xpcom/glue/standalone/*.o | c++filt | egrep -i ' [^uw] (gtls|ns_ismain)'
  xpcom/threads/nsThreadManager.o:0000000000000000 B gTLSThreadID
  xpcom/glue/standalone/nsThreadUtils.o:0000000000000000 T NS_IsMainThread()

  $ readelf -a xpcom/threads/nsThreadManager.o | grep -i gtlsthreadid
  00000000cec5  011e00000015 R_X86_64_DTPOFF32 0000000000000000 gTLSThreadID + 0
  000000000008  011e00000013 R_X86_64_TLSGD    0000000000000000 gTLSThreadID + fffffffffffffffc
  Relocation section '.rela.text._GLOBAL__I_gTLSThreadID' at offset 0x2c338 contains 1 entries:
  00000000017f  011e00000013 R_X86_64_TLSGD    0000000000000000 gTLSThreadID + fffffffffffffffc
       9: 0000000000000000    21 FUNC    LOCAL  DEFAULT  242 _GLOBAL__I_gTLSThreadID
     286: 0000000000000000     4 TLS     GLOBAL HIDDEN  345 gTLSThreadID

  $ ar t dist/lib/libxpcomglue.a | fgrep -i thread
  nsThreadUtils.o

  $ sed -n '/^lib.*\\/I,/xpcom/Ip' browser/app/Makefile.in
  LIBS += \
          $(EXTRA_DSO_LIBS) \
          $(XPCOM_STANDALONE_GLUE_LDOPTS) \

%%
--- xpcom/threads/nsThreadManager.cpp~
+++ xpcom/threads/nsThreadManager.cpp
@@ -89,6 +89,10 @@ NS_IMPL_CI_INTERFACE_GETTER1(nsThreadMan
 nsresult
 nsThreadManager::Init()
 {
+#ifdef NS_TLS
+  if (!gTLSThreadID)
+    gTLSThreadID = mozilla::threads::Generic;
+#endif
   if (!mThreadsByPRThread.Init())
     return NS_ERROR_OUT_OF_MEMORY;
 
%%


More information about the freebsd-gecko mailing list