<div dir="ltr"><div dir="ltr">On Sat, Mar 13, 2021 at 9:36 AM Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</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"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 5, 2021 at 1:15 AM Siva Chandra via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">sivachandra added a comment.<br>
<br>
In D97736#2605535 <<a href="https://reviews.llvm.org/D97736#2605535" rel="noreferrer" target="_blank">https://reviews.llvm.org/D97736#2605535</a>>, @phosek wrote:<br>
<br>
> Have you considered using an input linker script? We could generate `libc.so` that could look something like:<br>
><br>
>   INPUT(libllvmlibc.a /lib/libc.so)<br>
><br>
> We would need to pass `--sysroot` to the linker for this to work. The driver could remain completely agnostic of whether you're using LLVM libc or not.<br>
<br>
Yes, that was also considered. Those downstream users who have the flexibility to do it that way should be able to do it that way. However, not all downstream users or normal clang users will have that liberty [1]. Another point to note is that we will have to do this with all libc components like `libc.so`, `libm.so` etc.<br>
<br>
[1] I think all of this can be done. For example, we can set all this up when building a distribution. However, I am not sure this is worth it when we know this is a transient phase. Soon, when LLVM libc is complete enough, a more appropriate option would be the one which allows choosing a libc as Eric pointed out.<br></blockquote><div><br></div><div>To be clear I'm not a fan of a "pick your libc" option as opposed to just naming the compiled llvm libc as perhaps libc.[a,so,etc] similar to other platforms. I think we'd need a good reason to diverge here.</div></div></div></blockquote><div><br></div><div>The reason is that LLVM libc is not a libc until it can be one. This option is being added so that one can use LLVM libc as a source of alternate implementations. Once LLVM libc can actually be a full libc, this option is not required. Also, from that point in time, the LLVM libc binary should be given the conventional libc.<something> name as you suggest.</div></div></div>