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

2021-03-13 Thread Siva Chandra via cfe-commits
On Sat, Mar 13, 2021 at 9:36 AM Eric Christopher wrote: > > > On Fri, Mar 5, 2021 at 1:15 AM Siva Chandra via Phabricator < > revi...@reviews.llvm.org> wrote: > >> sivachandra added a comment. >> >> In D97736#2605535 , @phosek >> wrote: >> >> > Have you

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

2021-03-13 Thread Eric Christopher via cfe-commits
On Fri, Mar 5, 2021 at 1:15 AM Siva Chandra via Phabricator < revi...@reviews.llvm.org> wrote: > sivachandra added a comment. > > In D97736#2605535 , @phosek > wrote: > > > Have you considered using an input linker script? We could generate > `libc.so`

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In 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

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

2021-03-04 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. 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

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 328380. sivachandra added a comment. Remove empty '//' in lit test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97736/new/ https://reviews.llvm.org/D97736 Files:

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In D97736#2605432 , @echristo wrote: > In addition to the bikeshed below, I'm not a huge fan of this in general. I > think we should assume that the libc we link is complete and thus it would > just be named "libc." and in a

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In D97736#2605432 , @echristo wrote: > In addition to the bikeshed below, I'm not a huge fan of this in general. I > think we should assume that the libc we link is complete and thus it would > just be named "libc." and in a

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

2021-03-04 Thread Eric Christopher via Phabricator via cfe-commits
echristo added a comment. In addition to the bikeshed below, I'm not a huge fan of this in general. I think we should assume that the libc we link is complete and thus it would just be named "libc." and in a sysroot somewhere. Another option is perhaps looking at the rtlib option, but I'd want

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

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. If the end goal is to provide a complete libc, and currently the usage is expected to shadow system libc (this has to be very careful, as I don't know how shadowing some important components like pthread shall work), perhaps the name should convey this point?

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:680 +for (StringRef Arg : CmdArgs) { + if (Arg == "-lm" || Arg == "-lc") { +// TODO: Add -lllvmlibc before -lpthread when LLVM libc has pthread sivachandra wrote:

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:680 +for (StringRef Arg : CmdArgs) { + if (Arg == "-lm" || Arg == "-lc") { +// TODO: Add -lllvmlibc before -lpthread when LLVM libc has pthread phosek wrote: >

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 328340. sivachandra added a comment. Address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97736/new/ https://reviews.llvm.org/D97736 Files: clang/include/clang/Driver/Options.td

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

2021-03-04 Thread Petr Hosek via Phabricator via cfe-commits
phosek added inline comments. Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:680 +for (StringRef Arg : CmdArgs) { + if (Arg == "-lm" || Arg == "-lc") { +// TODO: Add -lllvmlibc before -lpthread when LLVM libc has pthread This wouldn't handle

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

2021-03-01 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra created this revision. sivachandra added a reviewer: phosek. Herald added subscribers: jansvoboda11, dang. sivachandra requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The experimental option is named