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

2022-02-11 Thread Louis Dionne via Phabricator via cfe-commits
ldionne marked an inline comment as done.
ldionne added inline comments.



Comment at: llvm/docs/GettingStarted.rst:1225
 
+* -DLLVM_ENABLE_RUNTIMES
+   Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, 
etc.)

Arfrever wrote:
> One space is missing before `*`, so currently this part of this page is 
> rendered incorrectly. See 
> https://github.com/llvm/llvm-project/blob/main/llvm/docs/GettingStarted.rst 
> (close to the end).
> 
> (When you fix it, please also backport fix to branch `release/14.x`.)
Thanks, good catch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-11 Thread Arfrever Frehtes Taifersar Arahesis via Phabricator via cfe-commits
Arfrever added inline comments.



Comment at: llvm/docs/GettingStarted.rst:1225
 
+* -DLLVM_ENABLE_RUNTIMES
+   Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, 
etc.)

One space is missing before `*`, so currently this part of this page is 
rendered incorrectly. See 
https://github.com/llvm/llvm-project/blob/main/llvm/docs/GettingStarted.rst 
(close to the end).

(When you fix it, please also backport fix to branch `release/14.x`.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-10 Thread Louis Dionne via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4ae83bb2b1e2: Update all LLVM documentation mentioning 
runtimes in LLVM_ENABLE_PROJECTS (authored by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

Files:
  README.md
  bolt/docs/OptimizingClang.md
  clang/docs/DataFlowSanitizer.rst
  clang/docs/Toolchain.rst
  compiler-rt/www/index.html
  flang/README.md
  libcxx/docs/BuildingLibcxx.rst
  libunwind/docs/BuildingLibunwind.rst
  llvm/docs/BuildingADistribution.rst
  llvm/docs/CMake.rst
  llvm/docs/GettingStarted.rst

Index: llvm/docs/GettingStarted.rst
===
--- llvm/docs/GettingStarted.rst
+++ llvm/docs/GettingStarted.rst
@@ -623,10 +623,15 @@
 | | other LLVM subprojects to additionally build. (Only|
 | | effective when using a side-by-side project layout |
 | | e.g. via git). The default list is empty. Can  |
-| | include: clang, clang-tools-extra, compiler-rt,|
-| | cross-project-tests, flang, libc, libclc, libcxx,  |
-| | libcxxabi, libunwind, lld, lldb, mlir, openmp, |
-| | polly, or pstl.|
+| | include: clang, clang-tools-extra, |
+| | cross-project-tests, flang, libc, libclc, lld, |
+| | lldb, mlir, openmp, polly, or pstl.|
++-++
+| LLVM_ENABLE_RUNTIMES| A semicolon-delimited list selecting which of the  |
+| | runtimes to build. (Only effective when using the  |
+| | full monorepo layout). The default list is empty.  |
+| | Can include: compiler-rt, libc, libcxx, libcxxabi, |
+| | libunwind, or openmp.  |
 +-++
 | LLVM_ENABLE_SPHINX  | Build sphinx-based documentation from the source   |
 | | code. This is disabled by default because it is|
@@ -1217,6 +1222,11 @@
compiling more than one project, separate the items with a semicolon. Should
you run into issues with the semicolon, try surrounding it with single quotes.
 
+* -DLLVM_ENABLE_RUNTIMES
+   Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, etc.)
+   If compiling more than one runtime, separate the items with a semicolon. Should
+   you run into issues with the semicolon, try surrounding it with single quotes.
+
  * -DCLANG_ENABLE_STATIC_ANALYZER
Set this option to OFF if you do not require the clang static analyzer. This
should improve your build time slightly.
Index: llvm/docs/CMake.rst
===
--- llvm/docs/CMake.rst
+++ llvm/docs/CMake.rst
@@ -221,6 +221,10 @@
   Control which projects are enabled. For example you may want to work on clang
   or lldb by specifying ``-DLLVM_ENABLE_PROJECTS="clang;lldb"``.
 
+**LLVM_ENABLE_RUNTIMES**:STRING
+  Control which runtimes are enabled. For example you may want to work on
+  libc++ or libc++abi by specifying ``-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``.
+
 **LLVM_LIBDIR_SUFFIX**:STRING
   Extra suffix to append to the directory where libraries are to be
   installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
@@ -505,17 +509,17 @@
 
 **LLVM_ENABLE_PROJECTS**:STRING
   Semicolon-separated list of projects to build, or *all* for building all
-  (clang, lldb, compiler-rt, lld, polly, etc) projects. This flag assumes
-  that projects are checked out side-by-side and not nested, i.e. clang
-  needs to be in parallel of llvm instead of nested in `llvm/tools`.
-  This feature allows to have one build for only LLVM and another for clang+llvm
-  using the same source checkout.
+  (clang, lldb, lld, polly, etc) projects. This flag assumes that projects
+  are checked out side-by-side and not nested, i.e. clang needs to be in
+  parallel of llvm instead of nested in `llvm/tools`. This feature allows
+  to have one build for only LLVM and another for clang+llvm using the same
+  source checkout.
   The full list is:
-  ``clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
+  ``clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
 
 **LLVM_ENABLE_RUNTIMES**:STRING
-  Build libc++, libc++abi or other projects using that a just-built compiler.
-  This is the correct way to build libc++ when putting together a toolchain.
+  Build 

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

2022-02-10 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added inline comments.



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 \
+-DLLVM_TARGETS_TO_BUILD=X86 \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_C_COMPILER=$CPATH/clang -DCMAKE_CXX_COMPILER=$CPATH/clang++ \
 -DLLVM_ENABLE_PROJECTS="clang;lld" \
 -DLLVM_USE_LINKER=lld -DLLVM_BUILD_INSTRUMENTED=ON \

Quuxplusone wrote:
> ldionne wrote:
> > 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 \
> > > -DLLVM_TARGETS_TO_BUILD=X86 \
> > > ~~~
> > > -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.
> > 
> > > Re: `CMAKE_INSTALL_PREFIX`
> > 
> > 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.
> FWIW, the `CMAKE_INSTALL_PREFIX` change is an improvement but only 
> //slightly// more reassuring than before. ;) Part of my paranoia is that I 
> happen to know that Homebrew stores things in `/usr/local/...` as well 
> (although probably entirely under `/usr/local/Cellar/...`?) and I wouldn't 
> want to blow those away //either//.
> Apparently on my Apple system I have `/usr/lib/libc++.dylib`, 
> `/System/DriverKit/usr/lib/libc++.dylib`, and 
> `/usr/local/Cellar/llvm/12.0.1/lib/libc++.dylib`.
> 
> > we test libc++ all the time without running the `install-cxx` target
> 
> Well, I know I do, but I don't use ENABLE_RUNTIMES yet... and the how-to 
> below //does// end with the line `ninja -C build install-cxx`. If there's a 
> supported/expected-to-work way to build and test libc++ that doesn't use 
> `ninja install-cxx`, it'd be cool to mention it.
> 
> Anyway, this is all just me fudding and shouldn't block this PR. :)
I think your comments are valid, but I think I would defer to @rafauler if they 
want to change the Bolt documentation in that way.

> Well, I know I do, but I don't use ENABLE_RUNTIMES yet...

FWIW, `LLVM_ENABLE_RUNTIMES` won't change anything with respect to that.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-10 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 407631.
ldionne marked 2 inline comments as done.
ldionne added a comment.

Address review comments. I'm going to commit this and cherry-pick onto 
release/14.x


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

Files:
  README.md
  bolt/docs/OptimizingClang.md
  clang/docs/DataFlowSanitizer.rst
  clang/docs/Toolchain.rst
  compiler-rt/www/index.html
  flang/README.md
  libcxx/docs/BuildingLibcxx.rst
  libunwind/docs/BuildingLibunwind.rst
  llvm/docs/BuildingADistribution.rst
  llvm/docs/CMake.rst
  llvm/docs/GettingStarted.rst

Index: llvm/docs/GettingStarted.rst
===
--- llvm/docs/GettingStarted.rst
+++ llvm/docs/GettingStarted.rst
@@ -623,10 +623,15 @@
 | | other LLVM subprojects to additionally build. (Only|
 | | effective when using a side-by-side project layout |
 | | e.g. via git). The default list is empty. Can  |
-| | include: clang, clang-tools-extra, compiler-rt,|
-| | cross-project-tests, flang, libc, libclc, libcxx,  |
-| | libcxxabi, libunwind, lld, lldb, mlir, openmp, |
-| | polly, or pstl.|
+| | include: clang, clang-tools-extra, |
+| | cross-project-tests, flang, libc, libclc, lld, |
+| | lldb, mlir, openmp, polly, or pstl.|
++-++
+| LLVM_ENABLE_RUNTIMES| A semicolon-delimited list selecting which of the  |
+| | runtimes to build. (Only effective when using the  |
+| | full monorepo layout). The default list is empty.  |
+| | Can include: compiler-rt, libc, libcxx, libcxxabi, |
+| | libunwind, or openmp.  |
 +-++
 | LLVM_ENABLE_SPHINX  | Build sphinx-based documentation from the source   |
 | | code. This is disabled by default because it is|
@@ -1217,6 +1222,11 @@
compiling more than one project, separate the items with a semicolon. Should
you run into issues with the semicolon, try surrounding it with single quotes.
 
+* -DLLVM_ENABLE_RUNTIMES
+   Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, etc.)
+   If compiling more than one runtime, separate the items with a semicolon. Should
+   you run into issues with the semicolon, try surrounding it with single quotes.
+
  * -DCLANG_ENABLE_STATIC_ANALYZER
Set this option to OFF if you do not require the clang static analyzer. This
should improve your build time slightly.
Index: llvm/docs/CMake.rst
===
--- llvm/docs/CMake.rst
+++ llvm/docs/CMake.rst
@@ -221,6 +221,10 @@
   Control which projects are enabled. For example you may want to work on clang
   or lldb by specifying ``-DLLVM_ENABLE_PROJECTS="clang;lldb"``.
 
+**LLVM_ENABLE_RUNTIMES**:STRING
+  Control which runtimes are enabled. For example you may want to work on
+  libc++ or libc++abi by specifying ``-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``.
+
 **LLVM_LIBDIR_SUFFIX**:STRING
   Extra suffix to append to the directory where libraries are to be
   installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
@@ -505,17 +509,17 @@
 
 **LLVM_ENABLE_PROJECTS**:STRING
   Semicolon-separated list of projects to build, or *all* for building all
-  (clang, lldb, compiler-rt, lld, polly, etc) projects. This flag assumes
-  that projects are checked out side-by-side and not nested, i.e. clang
-  needs to be in parallel of llvm instead of nested in `llvm/tools`.
-  This feature allows to have one build for only LLVM and another for clang+llvm
-  using the same source checkout.
+  (clang, lldb, lld, polly, etc) projects. This flag assumes that projects
+  are checked out side-by-side and not nested, i.e. clang needs to be in
+  parallel of llvm instead of nested in `llvm/tools`. This feature allows
+  to have one build for only LLVM and another for clang+llvm using the same
+  source checkout.
   The full list is:
-  ``clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
+  ``clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
 
 **LLVM_ENABLE_RUNTIMES**:STRING
-  Build libc++, libc++abi or other projects using that a just-built compiler.
-  This is the correct way to build libc++ when putting together a toolchain.
+  Build libc++, libc++abi, libunwind or compiler-rt using the 

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

2022-02-10 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments.



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 \
+-DLLVM_TARGETS_TO_BUILD=X86 \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_C_COMPILER=$CPATH/clang -DCMAKE_CXX_COMPILER=$CPATH/clang++ \
 -DLLVM_ENABLE_PROJECTS="clang;lld" \
 -DLLVM_USE_LINKER=lld -DLLVM_BUILD_INSTRUMENTED=ON \

ldionne wrote:
> 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 \
> > -DLLVM_TARGETS_TO_BUILD=X86 \
> > ~~~
> > -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.
> 
> > Re: `CMAKE_INSTALL_PREFIX`
> 
> 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.
FWIW, the `CMAKE_INSTALL_PREFIX` change is an improvement but only //slightly// 
more reassuring than before. ;) Part of my paranoia is that I happen to know 
that Homebrew stores things in `/usr/local/...` as well (although probably 
entirely under `/usr/local/Cellar/...`?) and I wouldn't want to blow those away 
//either//.
Apparently on my Apple system I have `/usr/lib/libc++.dylib`, 
`/System/DriverKit/usr/lib/libc++.dylib`, and 
`/usr/local/Cellar/llvm/12.0.1/lib/libc++.dylib`.

> we test libc++ all the time without running the `install-cxx` target

Well, I know I do, but I don't use ENABLE_RUNTIMES yet... and the how-to below 
//does// end with the line `ninja -C build install-cxx`. If there's a 
supported/expected-to-work way to build and test libc++ that doesn't use `ninja 
install-cxx`, it'd be cool to mention it.

Anyway, this is all just me fudding and shouldn't block this PR. :)



Comment at: llvm/docs/GettingStarted.rst:633-634
+| | full monorepo layout). The default list is empty.  
|
+| | Can include: libcxx, libcxxabi, libunwind, 
|
+| | compiler-rt, libc, or openmp.  
|
 
+-++

The other list is a-z order; this one could be too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-10 Thread Louis Dionne via Phabricator via cfe-commits
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 \
+-DLLVM_TARGETS_TO_BUILD=X86 \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_C_COMPILER=$CPATH/clang -DCMAKE_CXX_COMPILER=$CPATH/clang++ \
 -DLLVM_ENABLE_PROJECTS="clang;lld" \
 -DLLVM_USE_LINKER=lld -DLLVM_BUILD_INSTRUMENTED=ON \

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 \
> -DLLVM_TARGETS_TO_BUILD=X86 \
> ~~~
> -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.

> Re: `CMAKE_INSTALL_PREFIX`

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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-10 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 407500.
ldionne marked 3 inline comments as done.
ldionne added a comment.

Address review comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

Files:
  README.md
  bolt/docs/OptimizingClang.md
  clang/docs/DataFlowSanitizer.rst
  clang/docs/Toolchain.rst
  compiler-rt/www/index.html
  flang/README.md
  libcxx/docs/BuildingLibcxx.rst
  libunwind/docs/BuildingLibunwind.rst
  llvm/docs/BuildingADistribution.rst
  llvm/docs/CMake.rst
  llvm/docs/GettingStarted.rst

Index: llvm/docs/GettingStarted.rst
===
--- llvm/docs/GettingStarted.rst
+++ llvm/docs/GettingStarted.rst
@@ -623,10 +623,15 @@
 | | other LLVM subprojects to additionally build. (Only|
 | | effective when using a side-by-side project layout |
 | | e.g. via git). The default list is empty. Can  |
-| | include: clang, clang-tools-extra, compiler-rt,|
-| | cross-project-tests, flang, libc, libclc, libcxx,  |
-| | libcxxabi, libunwind, lld, lldb, mlir, openmp, |
-| | polly, or pstl.|
+| | include: clang, clang-tools-extra, |
+| | cross-project-tests, flang, libc, libclc, lld, |
+| | lldb, mlir, openmp, polly, or pstl.|
++-++
+| LLVM_ENABLE_RUNTIMES| A semicolon-delimited list selecting which of the  |
+| | runtimes to build. (Only effective when using the  |
+| | full monorepo layout). The default list is empty.  |
+| | Can include: libcxx, libcxxabi, libunwind, |
+| | compiler-rt, libc, or openmp.  |
 +-++
 | LLVM_ENABLE_SPHINX  | Build sphinx-based documentation from the source   |
 | | code. This is disabled by default because it is|
@@ -1217,6 +1222,11 @@
compiling more than one project, separate the items with a semicolon. Should
you run into issues with the semicolon, try surrounding it with single quotes.
 
+* -DLLVM_ENABLE_RUNTIMES
+   Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, etc.)
+   If compiling more than one runtime, separate the items with a semicolon. Should
+   you run into issues with the semicolon, try surrounding it with single quotes.
+
  * -DCLANG_ENABLE_STATIC_ANALYZER
Set this option to OFF if you do not require the clang static analyzer. This
should improve your build time slightly.
Index: llvm/docs/CMake.rst
===
--- llvm/docs/CMake.rst
+++ llvm/docs/CMake.rst
@@ -221,6 +221,10 @@
   Control which projects are enabled. For example you may want to work on clang
   or lldb by specifying ``-DLLVM_ENABLE_PROJECTS="clang;lldb"``.
 
+**LLVM_ENABLE_RUNTIMES**:STRING
+  Control which runtimes are enabled. For example you may want to work on
+  libc++ or libc++abi by specifying ``-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``.
+
 **LLVM_LIBDIR_SUFFIX**:STRING
   Extra suffix to append to the directory where libraries are to be
   installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
@@ -505,17 +509,17 @@
 
 **LLVM_ENABLE_PROJECTS**:STRING
   Semicolon-separated list of projects to build, or *all* for building all
-  (clang, lldb, compiler-rt, lld, polly, etc) projects. This flag assumes
-  that projects are checked out side-by-side and not nested, i.e. clang
-  needs to be in parallel of llvm instead of nested in `llvm/tools`.
-  This feature allows to have one build for only LLVM and another for clang+llvm
-  using the same source checkout.
+  (clang, lldb, lld, polly, etc) projects. This flag assumes that projects
+  are checked out side-by-side and not nested, i.e. clang needs to be in
+  parallel of llvm instead of nested in `llvm/tools`. This feature allows
+  to have one build for only LLVM and another for clang+llvm using the same
+  source checkout.
   The full list is:
-  ``clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
+  ``clang;clang-tools-extra;cross-project-tests;libc;libclc;lld;lldb;openmp;polly;pstl``
 
 **LLVM_ENABLE_RUNTIMES**:STRING
-  Build libc++, libc++abi or other projects using that a just-built compiler.
-  This is the correct way to build libc++ when putting together a toolchain.
+  Build libc++, libc++abi, libunwind or compiler-rt using the just-built compiler.
+  This is the correct way to build runtimes 

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

2022-02-09 Thread Shilei Tian via Phabricator via cfe-commits
tianshilei1992 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.
 

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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision.
MaskRay added a comment.

Thanks  for improving the documentation. I occasionally see folks (and two 
today!) puzzled by LLVM_ENABLE_RUNTIMES and this patch should help them.

Personally I use the `-S -B` style (actually `-H`, but now I see that `-S` is 
documented I will switch).
I sometimes twiddle with a cmake file and spawn multiple builds.
Not changing the work directory makes my commands simpler, but I do see 
@Quuxplusone's point about `-DCMAKE_INSTALL_PREFIX=$(pwd)/install`.

I rarely use `CMAKE_INSTALL_PREFIX`. When I need it, I accept the slight 
inconvenience of duplicating the build directory twice for `-B` and 
`-DCMAKE_INSTALL_PREFIX`.

I have read the updated and they look good to me, but happy if we switch to 
@Quuxplusone's style.
I passes the link to some folks and hope that fresh eyes with less 
LLVM_ENABLE_RUNTIMES experience can make suggestions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-09 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments.



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 \
+-DLLVM_TARGETS_TO_BUILD=X86 \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_C_COMPILER=$CPATH/clang -DCMAKE_CXX_COMPILER=$CPATH/clang++ \
 -DLLVM_ENABLE_PROJECTS="clang;lld" \
 -DLLVM_USE_LINKER=lld -DLLVM_BUILD_INSTRUMENTED=ON \

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 \
-DLLVM_TARGETS_TO_BUILD=X86 \
~~~
-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?



Comment at: flang/README.md:37
+If you are interested in writing new documentation, follow
 [markdown style guide from 
LLVM](https://github.com/llvm/llvm-project/blob/main/llvm/docs/MarkdownQuickstartTemplate.md).
 




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-09 Thread Rafael Auler via Phabricator via cfe-commits
rafauler added a comment.

BOLT modifications LGTM, thanks


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119351/new/

https://reviews.llvm.org/D119351

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-02-09 Thread Louis Dionne via Phabricator via cfe-commits
ldionne created this revision.
Herald added subscribers: libcxx-commits, ayermolo, arphaman, mgorny.
Herald added a reviewer: sscalpone.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added projects: libunwind, Flang.
Herald added a reviewer: libunwind.
ldionne requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, Sanitizers, cfe-commits, yota9, 
sstefan1, jdoerfert.
Herald added projects: clang, Sanitizers, libc++, LLVM.
Herald added a reviewer: libc++.

We are moving away from building the runtimes with LLVM_ENABLE_PROJECTS,
however the documentation was largely outdated. This commit updates all
the documentation I could find to use LLVM_ENABLE_RUNTIMES instead of
LLVM_ENABLE_PROJECTS for building runtimes.

Note that in the near future, libcxx, libcxxabi and libunwind will stop
supporting being built with LLVM_ENABLE_PROJECTS altogether. I don't know
what the plans are for other runtimes like libc, openmp and compiler-rt,
so I didn't make any changes to the documentation that would imply
something for those projects.

Once this lands, I will also cherry-pick this on the release/14.x branch
to make sure that LLVM's documentation is up-to-date and reflects what
we intend to support in the future.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119351

Files:
  README.md
  bolt/docs/OptimizingClang.md
  clang/docs/DataFlowSanitizer.rst
  clang/docs/Toolchain.rst
  compiler-rt/www/index.html
  flang/README.md
  libcxx/docs/BuildingLibcxx.rst
  libunwind/docs/BuildingLibunwind.rst
  llvm/docs/BuildingADistribution.rst
  llvm/docs/CMake.rst
  llvm/docs/GettingStarted.rst

Index: llvm/docs/GettingStarted.rst
===
--- llvm/docs/GettingStarted.rst
+++ llvm/docs/GettingStarted.rst
@@ -623,10 +623,15 @@
 | | other LLVM subprojects to additionally build. (Only|
 | | effective when using a side-by-side project layout |
 | | e.g. via git). The default list is empty. Can  |
-| | include: clang, clang-tools-extra, compiler-rt,|
-| | cross-project-tests, flang, libc, libclc, libcxx,  |
-| | libcxxabi, libunwind, lld, lldb, mlir, openmp, |
-| | polly, or pstl.|
+| | include: clang, clang-tools-extra, |
+| | cross-project-tests, flang, libc, libclc, lld, |
+| | lldb, mlir, openmp, polly, or pstl.|
++-++
+| LLVM_ENABLE_RUNTIMES| A semicolon-delimited list selecting which of the  |
+| | runtimes to build. (Only effective when using the  |
+| | full monorepo layout). The default list is empty.  |
+| | Can include: libcxx, libcxxabi, libunwind, |
+| | compiler-rt, libc, or openmp.  |
 +-++
 | LLVM_ENABLE_SPHINX  | Build sphinx-based documentation from the source   |
 | | code. This is disabled by default because it is|
@@ -1217,6 +1222,11 @@
compiling more than one project, separate the items with a semicolon. Should
you run into issues with the semicolon, try surrounding it with single quotes.
 
+* -DLLVM_ENABLE_RUNTIMES
+   Set this equal to the runtimes you wish to compile (e.g. libcxx, libcxxabi, etc.)
+   If compiling more than one runtime, separate the items with a semicolon. Should
+   you run into issues with the semicolon, try surrounding it with single quotes.
+
  * -DCLANG_ENABLE_STATIC_ANALYZER
Set this option to OFF if you do not require the clang static analyzer. This
should improve your build time slightly.
Index: llvm/docs/CMake.rst
===
--- llvm/docs/CMake.rst
+++ llvm/docs/CMake.rst
@@ -221,6 +221,10 @@
   Control which projects are enabled. For example you may want to work on clang
   or lldb by specifying ``-DLLVM_ENABLE_PROJECTS="clang;lldb"``.
 
+**LLVM_ENABLE_RUNTIMES**:STRING
+  Control which runtimes are enabled. For example you may want to work on
+  libc++ or libc++abi by specifying ``-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``.
+
 **LLVM_LIBDIR_SUFFIX**:STRING
   Extra suffix to append to the directory where libraries are to be
   installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
@@ -505,17 +509,17 @@
 
 **LLVM_ENABLE_PROJECTS**:STRING
   Semicolon-separated list of projects to build, or *all* for building all
-  (clang, lldb, compiler-rt, lld, polly, etc) projects. This