[llvm-dev] Compiler support in libc++

Louis Dionne via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 4 07:18:19 PST 2021



> On Mar 4, 2021, at 01:19, Petr Hosek via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> On Wed, Mar 3, 2021 at 9:06 PM Mehdi AMINI via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
> 
> 
> On Wed, Mar 3, 2021 at 5:34 PM Michael Kruse <llvmdev at meinersbur.de <mailto:llvmdev at meinersbur.de>> wrote:
> Am Mi., 3. März 2021 um 13:18 Uhr schrieb Mehdi AMINI via llvm-dev
> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>>:
> > That's a good point:
> >  - stage1: build just clang with host clang-8/libstdc++
> > - stage1.5: build libc++ with stage1 clang
> > - stage 2: assemble toolchain with clang from stage1 and libc++ from stage2
> > - stage3: build test "anything" using stage2 (`ninja check-all` in the monorepo for example, but applicable to any other external project)
> 
> Stage 1.5 is exactly what cmake
> -DLLVM_ENABLE_RUNTIMES=libcxxabi;libcxx should do.  
> 
> Fantastic! It looks like the cmake option I was suggesting already exists actually :)
> 
> I had to read our CMake scripts to figure out how to use it though,
> 
> Documentation is definitely something that needs improving since right now it's basically completely absent.
>  
> looking at https://llvm.org/docs/BuildingADistribution.html#relevant-cmake-options <https://llvm.org/docs/BuildingADistribution.html#relevant-cmake-options> it mentions the CMake option, but just running locally `ninja` does not get them to be built, I had to explicitly call `ninja runtimes` to get libc++ to be built, I don't know if this is intended?
> 
> In all our examples, we always use `ninja distribution` and include `runtimes` in `LLVM_DISTRIBUTION_COMPONENTS` and I haven't thought of also including `runtimes` in the default target, but it makes sense and should be easy to fix.
>  
> I also need to explicitly have `-DLLVM_ENABLE_PROJECTS=clang` by the way otherwise `ninja runtimes` will error out obscurely at some point, the cmake handling of this option isn't defensive about it at the moment.
> 
> That's also something we could improve.
>  
> Anyway, I need to update the bot config to see if this "just works", but locally it seems promising!
> 
> The runtimes build is under active development and we're interested in hearing about issues so please let me know if you run into problems.

I will be changing the default way of building libc++ to the runtimes build (in the documentation). I am also in the process of adding a CI job to build and test libc++ with a bootstrapped Clang. Once those configurations are the default ones, we should be able to fix issues more easily as the usage of the runtimes build will increase. I do agree that it’s a bit difficult to find documentation on it right now though :-).

Louis

>  
> Thanks Michael!
> 
> -- 
> Mehdi
> 
> 
> 
>  
> 
> When I last looked at it, it did work and haven't noticed work on that
> front. However, I just re-tried and it actually does work. Thanks to
> anyone who fixed it ;-)
> 
> Michael
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210304/c7234635/attachment.html>


More information about the llvm-dev mailing list