[PATCH] D97736: [Driver] Add a experimental option to link to LLVM libc.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 13 09:36:42 PST 2021


On Fri, Mar 5, 2021 at 1:15 AM Siva Chandra via Phabricator <
reviews at reviews.llvm.org> wrote:

> sivachandra added a comment.
>
> In D97736#2605535 <https://reviews.llvm.org/D97736#2605535>, @phosek
> wrote:
>
> > Have you considered using an input linker script? We could generate
> `libc.so` that could look something like:
> >
> >   INPUT(libllvmlibc.a /lib/libc.so)
> >
> > 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.
>
> 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.
>
> [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.
>

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.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210313/a6df1952/attachment-0001.html>


More information about the cfe-commits mailing list