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
@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.