<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I am trying to build a completely GNU free linux toolchain for the raspberry pi.<br class=""><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Llvm with clang and lld</div><div class="">Clang builtins</div><div class="">Musl libc</div><div class="">libc++, libc++abi, libunwind</div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class="">For this reason I seem to have to use -fPIC in the C and CXX flags but everything seems to work ok.</div><div class=""><br class=""></div><div class="">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" class="">http://llvm.org/docs/HowToCrossCompileLLVM.html</a> .</div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Thank you,</div><div class="">Alex</div><div class=""><br class=""></div></body></html>