<div dir="ltr"><div dir="ltr">On Mon, Mar 25, 2019 at 7:05 AM David Demelier via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le 25/03/2019 à 14:41, Peter Smith a écrit :<br>
> Hello David,<br>
> <br>
> I don't know much about the specifics of Musl, so I'm responding generally.<br>
> <br>
> As I understand it, clang expects to find the compiler-rt libraries<br>
> relative to the resource directory, which you can find out the<br>
> location of with clang --print-resource-dir . By default it is<br>
> lib/clang/9.0.0 assuming you are building from master. I think that<br>
> -DCMAKE_INSTALL_PREFIX=/usr has broken that assumption. I think that<br>
> you would either need to take out the CMAKE_INSTALL_PREFIX or change<br>
> the location of the resource directory, which I think that you can<br>
> alter at build time.<br>
> <br>
<br>
You're right, I've just checked both packages in Alpine and Arch and <br>
they indeed move the /usr/lib/linux directory under the clang's one. <br>
I've fixed that it worked, now I still have to find the solution <br>
regarding crtbeginS.so and crtendS.so.<br></blockquote><div><br></div><div><a href="https://reviews.llvm.org/D28791">https://reviews.llvm.org/D28791</a> should address this. We're still discussing some related aspects on <a href="https://reviews.llvm.org/D59264">https://reviews.llvm.org/D59264</a>, but I'm hoping to reach a conclusion and land these changes this week.<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">
Thanks :)<br>
<br>
> I don't think that there is a way of preventing clang adding<br>
> crtbeginS.o and crtendS.o without --nostdlib or --nostartfiles but<br>
> using these options will also not add the other crt*.o files that you<br>
> may be expecting.<br>
> <br>
> There is a line in lib/Driver/Toolchains/Gnu.cpp which the Linux driver uses:<br>
> const bool HasCRTBeginEndFiles =<br>
>        ToolChain.getTriple().hasEnvironment() ||<br>
>        (ToolChain.getTriple().getVendor() != llvm::Triple::MipsTechnologies);<br>
> It looks like Musl may need to be included there?<br>
<br>
I'll have a look, I don't know much the lowest part of the toolchain <br>
build process so I don't understand very much what's going on there. <br>
Hopefully someone that has better low-level knowledges and use musl will <br>
be able to guide me for this.<br>
<br>
What can I tell is that musl provide those files:<br>
<br>
usr/lib/Scrt1.o<br>
usr/lib/crt1.o<br>
usr/lib/crti.o<br>
usr/lib/crtn.o<br>
usr/lib/ld-musl-x86_64.so.1<br>
<br>
Regards,<br>
<br>
-- <br>
David<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>