Issue 174075
Summary Relocation R_X86_64_TLSLD cannot be used against symbol 'X', recompile with -fPIC
Labels new issue
Assignees
Reporter irshadcc
    When I try to build with clang, I get the following error. After looking at the compilation commands, it seems that the fPIC is added by default. 

```text
ld.lld: error: relocation R_X86_64_TLSLD cannot be used against symbol rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >& rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::operator[]<rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&)::buffer; recompile with -fPIC
>>> defined in libmylib.a(task_builder.cc.o)
>>> referenced by document.h:690 (_deps/rapidjson-src/include/rapidjson/document.h:690)
```

After some debugging steps, I found that I can build the shared library successfully by removing some source files. So I believe it has nothing to do with the -fPIC and might be related to relocation overflow 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to