[llvm-dev] emulated-tls & lld lto

Carlo Kok via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 2 04:26:20 PDT 2017


Hi,

When targetting android (which doesn't support tls) I have to pass -mllvm -emulated-tls to get a working executable, however lld fails with:

lld.exe: error: TLS attribute mismatch: f_t31_RemObjects.Elements.System.SynchronizationContext.fCurrent
 >>> defined in 
 >>> defined in lto.tmp

Where
@f_t31_RemObjects.Elements.System.SynchronizationContext.fCurrent = hidden thread_local global %._RemObjects.Elements.System.SynchronizationContext* null

when linking two bitcode files. I'm currently having a bit of trouble reproducing this with a simple testcase so I wanted to ask if anyone knows what could cause this?

This happens in SymbolTable::insert, the first time it inserts a symbol when loading the Archive file, which sets it as TLS symbol. The second time when it actually did LTO and it's not TLS anymore.

Carlo Kok
RemObjects Software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171002/93afb5d8/attachment.html>


More information about the llvm-dev mailing list