Date: Tue, 23 Aug 2011 17:50:19 +0400 From: Test Rat <ttsestt@gmail.com> To: Florian Smeets <flo@freebsd.org> Cc: freebsd-gecko@freebsd.org Subject: Re: [SVN-Commit] r607 - branches/experimental/www/firefox-aurora Message-ID: <86pqjw1bl0.fsf@gmail.com> References: <201108032303.p73N3RQq064006@trillian.chruetertee.ch> <86liv2a8ll.fsf@gmail.com> <4E4184BA.9060701@FreeBSD.org> <8662m68j21.fsf@gmail.com> <4E419ED6.30709@FreeBSD.org> <86fwku7b6o.fsf@gmail.com> <4E52305E.3040108@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Florian Smeets <flo@freebsd.org> writes:
> On 21.08.2011 22:37, Test Rat wrote:
>> Florian Smeets<flo@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;
%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86pqjw1bl0.fsf>
