Patrik Hägglund H
2013-Jun-10 12:45 UTC
[LLVMdev] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?
I tried to compile LLVM with gcc-4.8.1 -flto. I got the following error, when linking lli, llc, opt, or libLTO.so: `LLVMX86CompilationCallback2' referenced in section `.text' of /tmp/cclv7BYB.ltrans0.ltrans.o: defined in discarded section `.text' of X86JITInfo.o (symbol from plugin) collect2: error: ld returned 1 exit status Removing the LLVM_LIBRARY_VISIBILITY attribute for LLVMX86CompilationCallback2 make the link pass for lli, llc, and opt, but not for libLTO.so. Any ideas why this happens? /Patrik Hägglund
Rafael Espíndola
2013-Jun-10 13:20 UTC
[LLVMdev] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?
On 10 June 2013 08:45, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote:> I tried to compile LLVM with gcc-4.8.1 -flto. I got the following error, when linking lli, llc, opt, or libLTO.so: > > `LLVMX86CompilationCallback2' referenced in section `.text' of /tmp/cclv7BYB.ltrans0.ltrans.o: defined in discarded section `.text' of X86JITInfo.o (symbol from plugin) > collect2: error: ld returned 1 exit status > > Removing the LLVM_LIBRARY_VISIBILITY attribute for LLVMX86CompilationCallback2 make the link pass for lli, llc, and opt, but not for libLTO.so. > > Any ideas why this happens?I don't think gcc's LTO sees references from inline asm. Does adding __attribute__((used)) work?> /Patrik HägglundCheers, Rafael
Reasonably Related Threads
- [LLVMdev] [PATCH] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?
- [LLVMdev] [PATCH] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?
- Gcc-4.9.0 trunk revision 208516 cannot compile openssh package with -flto
- [Dovecot-news] v2.2.30.1 released
- [LLVMdev] "anchor" method policy, request for clarification