<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jun 25, 2017 at 6:40 AM, Alessandro Pistocchi via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I am trying to build a completely GNU free linux toolchain for the raspberry pi.<br><div><br></div><div>I successfully managed to compile llvm and clang for armv7 hard float ( both as a cross compiler and as a native compiler ) together with the following:</div><div><br></div><div>Llvm with clang and lld</div><div>Clang builtins</div><div>Musl libc</div><div>libc++, libc++abi, libunwind</div><div><br></div><div>All works well with the only thing to notice being the need to use -fPIC in order to access some library functions when my own c/c++ programs access those functions.</div><div><br></div><div>The fact seems to be that musl libc exports some symbols as protected ( probably correctly ) and lld ( probably correctly ) says it cannot preempt those symbols.</div><div>For this reason I seem to have to use -fPIC in the C and CXX flags but everything seems to work ok.</div></div></div></blockquote><div><br></div><div>Is this the same problem mentioned in <a href="https://bugs.llvm.org/show_bug.cgi?id=32425">https://bugs.llvm.org/show_bug.cgi?id=32425</a>?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>Then I tried to use this compiler ( both the cross compiler and the native compiler ) to compile llvm + clang + lld ( I want to have the toolchain built with itself, again without any GNU software involved ) but when building the clang executable I ran into the arm relocation problems mentioned here in the “Hacks” section when using -fPIC: <a href="http://llvm.org/docs/HowToCrossCompileLLVM.html" target="_blank">http://llvm.org/docs/<wbr>HowToCrossCompileLLVM.html</a> .</div><div>On the other hand, I seem to need -fPIC otherwise cmake fails to find some libc functions such as futimes/futimens and many others. If I use -fPIC for CFLAGS but not for CXXFLAGS then cmake finds those symbols but then obviously fails at a later stage with lld unable to preempt those symbols.</div><div><br></div><div>This seems to be a conflict I cannot solve without someone within the llvm team fixing the arm relocation problem. Is there any estimate of when this could happen? I am happy to spend the time testing any solutions by building my own toolchain until it succeeds. Or is there any other solution?</div></div><div><br></div><div>Thank you,</div><div>Alex</div><div><br></div></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>