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>
Rafael Avila de Espindola via llvm-dev
2017-Oct-12 22:07 UTC
[llvm-dev] emulated-tls & lld lto
I also cannot create a testcase that reproduces tihs. What I find odd is that given @a = hidden thread_local global i32 42, align 4 llc with -emulated-tl produces the symbols "__emutls_v.a" and "__emutls_t.a", but not "a". Any idea how f_t31_RemObjects.Elements.System.SynchronizationContext.fCurrent is showing up in lto.tmp? Thanks, Rafael Carlo Kok via llvm-dev <llvm-dev at lists.llvm.org> writes:> 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 > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev