[PATCH] D119351: Update all LLVM documentation mentioning runtimes in LLVM_ENABLE_PROJECTS

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 10 05:35:34 PST 2022

ldionne added inline comments.

Comment at: README.md:71
+          mlir, openmp, polly, or pstl. ``LLVM_ENABLE_RUNTIMES`` can include any of
+          libcxx, libcxxabi, libunwind, or compiler-rt.
tianshilei1992 wrote:
> FWIW, OpenMP can be put into either of them. In OpenMP doc (https://openmp.llvm.org/SupportAndFAQ.html#q-how-to-build-an-openmp-gpu-offload-capable-compiler), we recommend to use `LLVM_ENABLE_RUNTIMES` to build OpenMP if users would like to use offloading features.
Thanks for the clarification, I tweaked the documentation a bit.

Comment at: bolt/docs/OptimizingClang.md:228-236
 $ CPATH=${TOPLEV}/stage1/install/bin/
-$ cmake -G Ninja ${TOPLEV}/llvm-project/llvm -DLLVM_TARGETS_TO_BUILD=X86 \
+$ cmake -G Ninja -S ${TOPLEV}/llvm-project/llvm -B ${TOPLEV}/stage2-prof-gen \
     -DCMAKE_BUILD_TYPE=Release \
     -DLLVM_ENABLE_PROJECTS="clang;lld" \
Quuxplusone wrote:
> FWIW, I personally prefer to run cmake and ninja //from// the build directory, i.e.
> ```
> $ mkdir ${TOPLEV}/llvm-project/llvm/stage2-prof-gen
> $ cd ${TOPLEV}/llvm-project/llvm/stage2-prof-gen
> $ CPATH=${TOPLEV}/stage1/install/bin
> $ cmake -G Ninja \
>     ~~~
>     -DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage2-prof-gen/install \
>     ../llvm-project/llvm
> $ ninja install
> ```
> This is the style that was used in `DataFlowSanitizer.rst` below, which you explicitly moved away from into `-B`/`-S`/`-C` land (where I find it harder to keep straight all the different extra options that are needed).
> Orthogonally, I'm worried that the advice on lines 73–74 of README.md doesn't mention `CMAKE_INSTALL_PREFIX`. When I'm building libc++ locally as part of my development workflow, I //absolutely do not// want to blow away my computer's default standard library installation; but what //do// I want to do? Should I use something like `-DCMAKE_INSTALL_PREFIX=$(pwd)/install` as depicted here? Can I really not get away with "running it out of the buildroot" the way I'm used to?— I //must// install it somewhere on my system in order to test it at all?
> Re: `-C` `-B` `-S`

I really like using those flags because it makes the command relocatable, i.e. it works regardless of where it is being run. As such, it's way more copy-pasteable too. However, since that's orthogonal to this change, I'll revert to the old style just so we have fewer things to argue about. But in general, for libc++/libc++abi/libunwind instructions, you'll find that I want things documented this way for that reason.


You don't necessarily need to install it in order to test it -- we test libc++ all the time without running the `install-cxx` target. Furthermore, I would expect that most systems nowadays have some sort of integrity protection that prevents you from doing something bad like that. Apple platforms certainly do -- you simply can't overwrite your `libc++.1.dylib` anymore and render your system unusable. Still, I'll add a word of caution to `CMAKE_INSTALL_PREFIX` above even though it's orthogonal to this patch -- it's easy enough to do.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list