------- Comment #17 from developer at sandoe-acoustics dot co dot uk 2010-04-01 08:02 ------- AFAICT the root problem does not relate to export of symbols from emutls (or to its use). Although this perhaps needs a different PR
The root problem is that the emutls implementation generates symbols in the data area that are (AFAICT) translated into thread-unique addresses by _emutls_get_address. The two symbols in question are declared static and private and are being optimized away. (you will find that the profile tests work at -O0). I am not sure why they are being optimized away when there is a reference to them in the asm file -- see (b) below. The variables need to be preserved and coalesced within one binary. a/ A work-round solution is to mark the two variables PUBLIC and COMMON. I've tested that this works on i686-apple-darwin and ia32-pc-linux .... BUT.... b/ Looking at http://gcc.gnu.org/ml/gcc/2010-03/msg00482.html It is perhaps the case that other attributes are not being copied that are causing this problem. Of course, maybe this is also a limitation of emutls. I don't have time to do much on this today -- and the trunk freeze is fast approaching.. input from more experienced would be welcome... -- developer at sandoe-acoustics dot co dot uk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |developer at sandoe- | |acoustics dot co dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43553