[llvm-dev] Guidance / examples of adding subprojects to a monorepo branch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Guidance / examples of adding subprojects to a monorepo branch

Shoaib Meenai via llvm-dev
Hi,

The move to a single repo has greatly simplified building llvm. Thank you.

I work on a toolchain which is essentially llvm plus a lot of runtime libraries. They're all checked out next to each other and built in a sequence. Some of the libraries need the just built clang to compile.

I would like to instead check out each runtime as a subproject within llvm and build the whole lot via one cmake invocation. Maybe even with correct incremental builds.

However, my grasp of cmake is limited and the cross compilation aspect has thwarted me. Please could you offer a pointer on how to wire this up, or even better, some project on GitHub which already assembles such a llvm+libs combination that I can copy from.

Thanks!

Jon

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [EXTERNAL] Guidance / examples of adding subprojects to a monorepo branch

Shoaib Meenai via llvm-dev

I can't speak with complete experience since my team is still working on it, but I believe the LLVM 'runtimes' feature might be what you're looking for. I believe it has support for adding third party runtime projects that use CMake by checking out the directories into llvm/runtimes. Our team has used it to build libcxx/libcxxabi/libunwind/compiler-rt builtins and profile with just-built compilers, but this code is unfortunately not public to show you. However, examples of cache files are in clang/cmake/caches. Of specific note is the Fuchsia cache files, which have a 2-stage toolchain build followed by a runtimes build using the just-built compiler.


If you utilize this feature, you'll get the ability to build everything within one cmake invocation, and even be able to install the libraries automatically as part of the distribution. There's also support for the concept of 'multilibs', which allow for building runtimes with the same target but slightly different options. This is helpful if you need variations with C++ exception support and variations without, for example.


There are a few snags we ran into, specifically:

  • https://reviews.llvm.org/D71570
  • An issue where LLVM_* configurations are overridden by the just-built clang value, rather than the runtimes-configured value


I found the following information helpful:


JB


From: llvm-dev <[hidden email]> on behalf of Jon Chesterfield via llvm-dev <[hidden email]>
Sent: Thursday, January 9, 2020 7:49:34 AM
To: llvm-dev
Subject: [EXTERNAL] [llvm-dev] Guidance / examples of adding subprojects to a monorepo branch
 
Hi,

The move to a single repo has greatly simplified building llvm. Thank you.

I work on a toolchain which is essentially llvm plus a lot of runtime libraries. They're all checked out next to each other and built in a sequence. Some of the libraries need the just built clang to compile.

I would like to instead check out each runtime as a subproject within llvm and build the whole lot via one cmake invocation. Maybe even with correct incremental builds.

However, my grasp of cmake is limited and the cross compilation aspect has thwarted me. Please could you offer a pointer on how to wire this up, or even better, some project on GitHub which already assembles such a llvm+libs combination that I can copy from.

Thanks!

Jon

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev