Commit Graph

340 Commits

Author SHA1 Message Date
Lang Hames a85e4aa37d [ORC-RT] Drop the 'clang_rt.' prefix from the ORC runtime.
The ORC runtime isn't used by clang -- the prefix was just cargo-culted with
the rest of the XRay config when the ORC runtime was introduced. We now want to
make parts of it available for clients to link directly, so this seems like a
good time to fix the name.
2022-09-12 16:48:20 -07:00
Vitaly Buka c059ede28e [msan] Add more specific messages for use-after-destroy
Reviewed By: kda, kstoimenov

Differential Revision: https://reviews.llvm.org/D132907
2022-08-30 19:52:32 -07:00
Akira Hatanaka caaafe4ae2 [compiler-rt][builtins] Revert all the recent changes I made for adding
security-related compiler flags

The changes broke Fuchsia builders.
2022-08-25 13:37:36 -07:00
Akira Hatanaka e1dcd4ba44 [compiler-rt][builtins] Add compiler flags to catch potential errors
that can lead to security vulnerabilities

Also, fix a few places that were causing -Wshadow and
-Wformat-nonliteral warnings to be emitted.

This reapplies the patch that was reverted in 0d66dc57e8 because it
broke a few bots.

I made changes so that cmake checks whether some of the flags are
supported by the compiler that is used before adding them to the list.
Also, I moved function add_security_warnings to CompilerRTUtils.cmake so
that it is defined before it's used.

Differential Revision: https://reviews.llvm.org/D131714
2022-08-24 15:52:31 -07:00
Teresa Johnson d10c1b88f0 [memprof] Correct max size and access count computations
The existing code resulted in the max size and access counts being equal
to the min. Compute the max instead (max lifetime was already correct).

Differential Revision: https://reviews.llvm.org/D132515
2022-08-23 16:53:46 -07:00
Akira Hatanaka 0d66dc57e8 Revert "[compiler-rt][builtins] Add compiler flags to catch potential errors"
This reverts commit 5f886adbfd.

It broke clang-hip-vega20.

https://lab.llvm.org/buildbot/#/builders/165/builds/23675
2022-08-22 16:39:15 -07:00
Akira Hatanaka 5f886adbfd [compiler-rt][builtins] Add compiler flags to catch potential errors
that can lead to security vulnerabilities

Also, fix a few places that were causing -Wshadow and
-Wformat-nonliteral warnings to be emitted.

Differential Revision: https://reviews.llvm.org/D131714
2022-08-22 16:27:22 -07:00
Lang Hames 232bd331cb [ORC-RT] Make the ORC runtime C API public.
This is a first step towards allowing programs to pre-link against the ORC
runtime, which would allow us to move some code that is currently in the LLVM
OrcTarget library into the ORC runtime instead.

The C API header has limited utility as-is, but serves as a minimal first step
and provides clients with tools for interacting with wrapper functions.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D127324
2022-06-16 19:02:23 -07:00
Snehasish Kumar 61c75eb637 [memprof] Initialize MemInfoBlock data.
This patch updates the existing default no-arg constructor for
MemInfoBlock to explicitly initialize all members. Also add missing
DataTypeId initialization to the other constructor. These issues were
exposed by msan on patch D121179. With this patch D121179 builds cleanly
on msan.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D122260
2022-03-22 14:35:57 -07:00
Snehasish Kumar 0a4184909a Reland "[memprof] Extend the index prof format to include memory profiles."
This patch adds support for optional memory profile information to be
included with and indexed profile. The indexed profile header adds a new
field which points to the offset of the memory profile section (if
present) in the indexed profile. For users who do not utilize this
feature the only overhead is a 64-bit offset in the header.

The memory profile section contains (1) profile metadata describing the
information recorded for each entry (2) an on-disk hashtable containing
the profile records indexed via llvm::md5(function_name). We chose to
introduce a separate hash table instead of the existing one since the
indexing for the instrumented fdo hash table is based on a CFG hash
which itself is perturbed by memprof instrumentation.

This commit also includes the changes reviewed separately in D120093.

Differential Revision: https://reviews.llvm.org/D120103
2022-02-17 22:09:52 -08:00
Snehasish Kumar 19bdf44d85 Revert "Reland "[memprof] Extend the index prof format to include memory profiles.""
This reverts commit 807ba7aace.
2022-02-17 15:51:04 -08:00
Snehasish Kumar 807ba7aace Reland "[memprof] Extend the index prof format to include memory profiles."
This reverts commit 85355a560a.

This patch adds support for optional memory profile information to be
included with and indexed profile. The indexed profile header adds a new
field which points to the offset of the memory profile section (if
present) in the indexed profile. For users who do not utilize this
feature the only overhead is a 64-bit offset in the header.

The memory profile section contains (1) profile metadata describing the
information recorded for each entry (2) an on-disk hashtable containing
the profile records indexed via llvm::md5(function_name). We chose to
introduce a separate hash table instead of the existing one since the
indexing for the instrumented fdo hash table is based on a CFG hash
which itself is perturbed by memprof instrumentation.

Differential Revision: https://reviews.llvm.org/D118653
2022-02-17 13:14:17 -08:00
Snehasish Kumar 50713461d4 Reland "[memprof] Introduce a wrapper around MemInfoBlock."
This reverts commit e6999040f5.

Update test to fix signed int comparison warning, fix whitespace in
compiler-rt MIBEntryDef.inc file.

Differential Revision: https://reviews.llvm.org/D117256
2022-02-14 19:04:36 -08:00
Snehasish Kumar f89319b841 Reland "[memprof] Refactor out the MemInfoBlock into a macro based def."
This reverts commit 857ec0d01f.

Fixes -DLLVM_ENABLE_MODULES=On build by adding the new textual
header to the modulemap file.

Reviewed in https://reviews.llvm.org/D117722
2022-02-14 16:05:05 -08:00
Snehasish Kumar 857ec0d01f Revert "[memprof] Refactor out the MemInfoBlock into a macro based def."
This reverts commit 9def83c6d0. [4/4]
2022-02-14 11:42:58 -08:00
Snehasish Kumar 85355a560a Revert "Reland "[memprof] Extend the index prof format to include memory profiles.""
This reverts commit de54e4ab78 [1/4]
2022-02-14 11:42:58 -08:00
Snehasish Kumar de54e4ab78 Reland "[memprof] Extend the index prof format to include memory profiles."
This reverts commit 0f73fb18ca.

Use llvm/Profile/MIBEntryDef.inc instead of relative path.

Generated the raw profile data with `-mllvm
-enable-name-compression=false` so that builbots where the reader is
built without zlib do not fail.

Also updated the test build instructions.
2022-02-14 10:52:13 -08:00
Snehasish Kumar 0f73fb18ca Revert "[memprof] Extend the index prof format to include memory profiles."
This reverts commit 43c2348c5b.

Buildbots are failing with an error on reading memprof testdata.
"Inputs/basic.profraw: profile uses zlib
compression but the profile reader was built without zlib support"

https://lab.llvm.org/buildbot/#/builders/16/builds/24490
2022-02-14 10:25:01 -08:00
Snehasish Kumar 43c2348c5b [memprof] Extend the index prof format to include memory profiles.
This patch adds support for optional memory profile information to be
included with and indexed profile. The indexed profile header adds a new
field which points to the offset of the memory profile section (if
present) in the indexed profile. For users who do not utilize this
feature the only overhead is a 64-bit offset in the header.

The memory profile section contains (1) profile metadata describing the
information recorded for each entry (2) an on-disk hashtable containing
the profile records indexed via llvm::md5(function_name). We chose to
introduce a separate hash table instead of the existing one since the
indexing for the instrumented fdo hash table is based on a CFG hash
which itself is perturbed by memprof instrumentation.

Differential Revision: https://reviews.llvm.org/D118653
2022-02-14 09:53:45 -08:00
Snehasish Kumar 9def83c6d0 [memprof] Refactor out the MemInfoBlock into a macro based def.
This patch refactors out the MemInfoBlock definition into a macro based
header which can be included to generate enums, structus and code for
each field recorded by the memprof profiling runtime.

Differential Revision: https://reviews.llvm.org/D117722
2022-02-14 09:53:45 -08:00
Rainer Orth d83c9005cf [sanitizer_common][test] Enable tests on SPARC
Unfortunately, the `sanitizer_common` tests are disabled on many targets
that are supported by `sanitizer_common`, making it easy to miss issues
with that support.  This patch enables SPARC testing.

Beside the enabling proper, the patch fixes (together with D91607
<https://reviews.llvm.org/D91607>) the failures of the `symbolize_pc.cpp`,
`symbolize_pc_demangle.cpp`, and `symbolize_pc_inline.cpp` tests.  They
lack calls to `__builtin_extract_return_addr`.  When those are added, they
`PASS` when compiled with `gcc`.  `clang` incorrectly doesn't implement a
non-default `__builtin_extract_return_addr` on several targets, SPARC
included.

Because `__builtin_extract_return_addr(__builtin_return_addr(0))` is quite
a mouthful and I'm uncertain if the code needs to compile with msvc which
appparently has it's own `_ReturnAddress`, I've introduced
`__sanitizer_return_addr` to hide the difference and complexity.  Because
on 32-bit SPARC `__builtin_extract_return_addr` differs when the calling
function returns a struct, I've added a testcase for that.

There are a couple more tests failing on SPARC that I will deal with
separately.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D91608
2022-02-01 22:33:56 +01:00
Snehasish Kumar 8306968b59 [memprof] Move the meminfo block struct to MemProfData.inc.
The definition of the MemInfoBlock is shared between the memprof
compiler-rt runtime and llvm/lib/ProfileData/. This change removes the
memprof_meminfoblock header and moves the struct to the shared include
file. To enable this sharing, the Print method is moved to the
memprof_allocator (the only place it is used) and the remaining uses are
updated to refer to the MemInfoBlock defined in the MemProfData.inc
file.

Also a couple of other minor changes which improve usability of the
types in MemProfData.inc.
* Update the PACKED macro to handle commas.
* Add constructors and equality operators.
* Don't initialize the buildid field.

Differential Revision: https://reviews.llvm.org/D116780
2022-01-31 15:04:41 -08:00
Ellis Hoag 11d3074267 [InstrProf] Add single byte coverage mode
Use the llvm flag `-pgo-function-entry-coverage` to create single byte "counters" to track functions coverage. This mode has significantly less size overhead in both code and data because
  * We mark a function as "covered" with a store instead of an increment which generally requires fewer assembly instructions
  * We use a single byte per function rather than 8 bytes per block

The trade off of course is that this mode only tells you if a function has been covered. This is useful, for example, to detect dead code.

When combined with debug info correlation [0] we are able to create an instrumented Clang binary that is only 150M (the vanilla Clang binary is 143M). That is an overhead of 7M (4.9%) compared to the default instrumentation (without value profiling) which has an overhead of 31M (21.7%).

[0] https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116180
2022-01-27 17:38:55 -08:00
Ellis Hoag ccb09a4889 Fix broken comment in InstrProfData.inc
This comment was introduced in https://reviews.llvm.org/D117631

Differential Revision: https://reviews.llvm.org/D117705
2022-01-19 10:38:13 -08:00
Ellis Hoag 88d81770f1 [InstrProf] Restore InstrProfData.inc to fix Fuchsia builds
https://reviews.llvm.org/D116179 introduced some changes to
`InstrProfData.inc` which broke some downstream builds. This commit
reverts those changes since they only changes two field names.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D117631
2022-01-19 10:10:58 -08:00
Ellis Hoag f21473752b [InstrProf][NFC] Do not assume size of counter type
Existing code tended to assume that counters had type `uint64_t` and
computed size from the number of counters. Fix this code to directly
compute the counters size in number of bytes where possible. When the
number of counters is needed, use `__llvm_profile_counter_entry_size()`
or `getCounterTypeSize()`. In a later diff these functions will depend
on the profile mode.

Change the meaning of `DataSize` and `CountersSize` to make them more clear.
* `DataSize` (`CountersSize`) - the size of the data (counter) section in bytes.
* `NumData` (`NumCounters`) - the number of data (counter) entries.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116179
2022-01-14 11:29:11 -08:00
Andrew Browne 4e173585f6 [DFSan] Add option for conditional callbacks.
This allows DFSan to find tainted values used to control program behavior.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D116207
2022-01-05 15:07:09 -08:00
Andrew Browne d39d2acfdd [DFSan] Make dfsan_read_origin_of_first_taint public.
Makes origins easier to use with dfsan_read_label(addr, size).

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116197
2021-12-22 23:45:30 -08:00
Andrew Browne ed6c757d5c [DFSan] Add functions to print origin trace from origin id instead of address.
dfsan_print_origin_id_trace
dfsan_sprint_origin_id_trace

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116184
2021-12-22 16:45:54 -08:00
Ellis Hoag 58d9c1aec8 [Try2][InstrProf] Attach debug info to counters
Add the llvm flag `-debug-info-correlate` to attach debug info to instrumentation counters so we can correlate raw profile data to their functions. Raw profiles are dumped as `.proflite` files. The next diff enables `llvm-profdata` to consume `.proflite` and debug info files to produce a normal `.profdata` profile.

Part of the "lightweight instrumentation" work: https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

The original diff https://reviews.llvm.org/D114565 was reverted because of the `Instrumentation/InstrProfiling/debug-info-correlate.ll` test, which is fixed in this commit.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D115693
2021-12-16 14:20:30 -08:00
Ellis Hoag c809da7d9c Revert "[InstrProf] Attach debug info to counters"
This reverts commit 800bf8ed29.

The `Instrumentation/InstrProfiling/debug-info-correlate.ll` test was
failing because I forgot the `llc` commands are architecture specific.
I'll follow up with a fix.

Differential Revision: https://reviews.llvm.org/D115689
2021-12-13 18:15:17 -08:00
Ellis Hoag 800bf8ed29 [InstrProf] Attach debug info to counters
Add the llvm flag `-debug-info-correlate` to attach debug info to instrumentation counters so we can correlate raw profile data to their functions. Raw profiles are dumped as `.proflite` files. The next diff enables `llvm-profdata` to consume `.proflite` and debug info files to produce a normal `.profdata` profile.

Part of the "lightweight instrumentation" work: https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D114565
2021-12-13 17:51:22 -08:00
Snehasish Kumar 7cca33b40f [memprof] Extend llvm-profdata to display MemProf profile summaries.
This commit adds initial support to llvm-profdata to read and print
summaries of raw memprof profiles.
Summary of changes:
* Refactor shared defs to MemProfData.inc
* Extend show_main to display memprof profile summaries.
* Add a simple raw memprof profile reader.
* Add a couple of tests to tools/llvm-profdata.

Differential Revision: https://reviews.llvm.org/D114286
2021-11-30 10:45:26 -08:00
Petr Hosek 24c615fa6b [InstrProfData] Bump the raw profile version to 8
This is to account for the change that made CountersPtr in __profd_
relative which landed in a1532ed275.
That change hasn't updated the raw profile version, and while the
profile layout stayed the same, profiles generated by tip-of-tree
LLVM are incompatible with 13.x tooling.

Differential Revision: https://reviews.llvm.org/D111123
2021-10-05 09:57:56 -07:00
Dmitry Vyukov ad890aa232 tsan: add a test for flushing memory
Add a test for __tsan_flush_memory() and for background
flushing of the runtime memory.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D110409
2021-09-24 15:59:19 +02:00
Kazuaki Ishizaki a1e7e401d2 [compiler-rt] NFC: Fix trivial typo
Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D77457
2021-09-04 14:12:58 +05:30
Vitaly Buka ecc2c9ba45 [sanitizer] Add callbacks for epoll_pwait2
Depends on D107207.

Differential Revision: https://reviews.llvm.org/D107209
2021-08-02 14:14:19 -07:00
Vitaly Buka 2564f27f18 [NFC][sanitizer] clang-format few files 2021-07-30 19:31:14 -07:00
Petr Hosek 83302c8489 [profile] Fix profile merging with binary IDs
This fixes support for merging profiles which broke as a consequence
of e50a38840d. The issue was missing
adjustment in merge logic to account for the binary IDs which are
now included in the raw profile just after header.

In addition, this change also:
* Includes the version in module signature that's used for merging
to avoid accidental attempts to merge incompatible profiles.
* Moves the binary IDs size field after version field in the header
as was suggested in the review.

Differential Revision: https://reviews.llvm.org/D107143
2021-07-30 18:54:27 -07:00
Petr Hosek d3dd07e3d0 Revert "[profile] Fix profile merging with binary IDs"
This reverts commit dcadd64986.
2021-07-30 18:53:48 -07:00
Vitaly Buka 44c83eccf9 [sanitizer] Remove cpplint annotations
cpplint was removed by D107197

Differential Revision: https://reviews.llvm.org/D107198
2021-07-30 18:20:40 -07:00
Petr Hosek dcadd64986 [profile] Fix profile merging with binary IDs
This fixes support for merging profiles which broke as a consequence
of e50a38840d. The issue was missing
adjustment in merge logic to account for the binary IDs which are
now included in the raw profile just after header.

In addition, this change also:
* Includes the version in module signature that's used for merging
to avoid accidental attempts to merge incompatible profiles.
* Moves the binary IDs size field after version field in the header
as was suggested in the review.

Differential Revision: https://reviews.llvm.org/D107143
2021-07-30 17:38:53 -07:00
Petr Hosek 6ea2f31f3d Revert "[profile] Fix profile merging with binary IDs"
This reverts commit 89d6eb6f8c, this
seemed to have break a few builders.
2021-07-30 14:32:52 -07:00
Petr Hosek 89d6eb6f8c [profile] Fix profile merging with binary IDs
This fixes support for merging profiles which broke as a consequence
of e50a38840d. The issue was missing
adjustment in merge logic to account for the binary IDs which are
now included in the raw profile just after header.

In addition, this change also:
* Includes the version in module signature that's used for merging
to avoid accidental attempts to merge incompatible profiles.
* Moves the binary IDs size field after version field in the header
as was suggested in the review.

Differential Revision: https://reviews.llvm.org/D107143
2021-07-30 13:30:30 -07:00
Fangrui Song a1532ed275 [InstrProfiling] Make CountersPtr in __profd_ relative
Change `CountersPtr` in `__profd_` to a label difference, which is a link-time
constant. On ELF, when linking a shared object, this requires that `__profc_` is
either private or linkonce/linkonce_odr hidden. On COFF, we need D104564 so that
`.quad a-b` (64-bit label difference) can lower to a 32-bit PC-relative relocation.

```
# ELF: R_X86_64_PC64 (PC-relative)
.quad .L__profc_foo-.L__profd_foo

# Mach-O: a pair of 8-byte X86_64_RELOC_UNSIGNED and X86_64_RELOC_SUBTRACTOR
.quad l___profc_foo-l___profd_foo

# COFF: we actually use IMAGE_REL_AMD64_REL32/IMAGE_REL_ARM64_REL32 so
# the high 32-bit value is zero even if .L__profc_foo < .L__profd_foo
# As compensation, we truncate CountersDelta in the header so that
# __llvm_profile_merge_from_buffer and llvm-profdata reader keep working.
.quad .L__profc_foo-.L__profd_foo
```

(Note: link.exe sorts `.lprfc` before `.lprfd` even if the object writer
has `.lprfd` before `.lprfc`, so we cannot work around by reordering
`.lprfc` and `.lprfd`.)

With this change, a stage 2 (`-DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_INSTRUMENTED=IR`)
`ld -pie` linked clang is 1.74% smaller due to fewer R_X86_64_RELATIVE relocations.
```
% readelf -r pie | awk '$3~/R.*/{s[$3]++} END {for (k in s) print k, s[k]}'
R_X86_64_JUMP_SLO 331
R_X86_64_TPOFF64 2
R_X86_64_RELATIVE 476059  # was: 607712
R_X86_64_64 2616
R_X86_64_GLOB_DAT 31
```

The absolute function address (used by llvm-profdata to collect indirect call
targets) can be converted to relative as well, but is not done in this patch.

Differential Revision: https://reviews.llvm.org/D104556
2021-07-30 11:52:18 -07:00
Gulfem Savrun Yeniceri e50a38840d [profile] Add binary id into profiles
This patch adds binary id into profiles to easily associate binaries
with the corresponding profiles. There is an RFC that discusses
the motivation, design and implementation in more detail:
https://lists.llvm.org/pipermail/llvm-dev/2021-June/151154.html

Differential Revision: https://reviews.llvm.org/D102039
2021-07-23 00:19:12 +00:00
Gulfem Savrun Yeniceri fd895bc81b Revert "[profile] Add binary id into profiles"
Revert "[profile] Change linkage type of a compiler-rt func"
This reverts commits f984ac2715 and
467c719124 because it broke some builds.
2021-07-21 19:15:18 +00:00
Gulfem Savrun Yeniceri f984ac2715 [profile] Add binary id into profiles
This patch adds binary id into profiles to easily associate binaries
with the corresponding profiles. There is an RFC that discusses
the motivation, design and implementation in more detail:
https://lists.llvm.org/pipermail/llvm-dev/2021-June/151154.html

Differential Revision: https://reviews.llvm.org/D102039
2021-07-21 17:55:43 +00:00
Petr Hosek 54902e00d1 [InstrProfiling] Use weak alias for bias variable
We need the compiler generated variable to override the weak symbol of
the same name inside the profile runtime, but using LinkOnceODRLinkage
results in weak symbol being emitted in which case the symbol selected
by the linker is going to depend on the order of inputs which can be
fragile.

This change replaces the use of weak definition inside the runtime with
a weak alias. We place the compiler generated symbol inside a COMDAT
group so dead definition can be garbage collected by the linker.

We also disable the use of runtime counter relocation on Darwin since
Mach-O doesn't support weak external references, but Darwin already uses
a different continous mode that relies on overmapping so runtime counter
relocation isn't needed there.

Differential Revision: https://reviews.llvm.org/D105176
2021-07-19 12:23:51 -07:00
John Ericson 1e03c37b97 Prepare Compiler-RT for GnuInstallDirs, matching libcxx, document all
This is a second attempt at D101497, which landed as
9a9bc76c0e but had to be reverted in
8cf7ddbdd4.

This issue was that in the case that `COMPILER_RT_INSTALL_PATH` is
empty, expressions like "${COMPILER_RT_INSTALL_PATH}/bin" evaluated to
"/bin" not "bin" as intended and as was originally.

One solution is to make `COMPILER_RT_INSTALL_PATH` always non-empty,
defaulting it to `CMAKE_INSTALL_PREFIX`. D99636 adopted that approach.
But, I think it is more ergonomic to allow those project-specific paths
to be relative the global ones. Also, making install paths absolute by
default inhibits the proper behavior of functions like
`GNUInstallDirs_get_absolute_install_dir` which make relative install
paths absolute in a more complicated way.

Given all this, I will define a function like the one asked for in
https://gitlab.kitware.com/cmake/cmake/-/issues/19568 (and needed for a
similar use-case).

---

Original message:

Instead of using `COMPILER_RT_INSTALL_PATH` through the CMake for
complier-rt, just use it to define variables for the subdirs which
themselves are used.

This preserves compatibility, but later on we might consider getting rid
of `COMPILER_RT_INSTALL_PATH` and just changing the defaults for the
subdir variables directly.

---

There was a seaming bug where the (non-Apple) per-target libdir was
`${target}` not `lib/${target}`. I suspect that has to do with the docs
on `COMPILER_RT_INSTALL_PATH` saying was the library dir when that's no
longer true, so I just went ahead and fixed it, allowing me to define
fewer and more sensible variables.

That last part should be the only behavior changes; everything else
should be a pure refactoring.

---

I added some documentation of these variables too. In particular, I
wanted to highlight the gotcha where `-DSomeCachePath=...` without the
`:PATH` will lead CMake to make the path absolute. See [1] for
discussion of the problem, and [2] for the brief official documentation
they added as a result.

[1]: https://cmake.org/pipermail/cmake/2015-March/060204.html

[2]: https://cmake.org/cmake/help/latest/manual/cmake.1.html#options

In 38b2dec37e the problem was somewhat
misidentified and so `:STRING` was used, but `:PATH` is better as it
sets the correct type from the get-go.

---

D99484 is the main thrust of the `GnuInstallDirs` work. Once this lands,
it should be feasible to follow both of these up with a simple patch for
compiler-rt analogous to the one for libcxx.

Reviewed By: phosek, #libc_abi, #libunwind

Differential Revision: https://reviews.llvm.org/D105765
2021-07-13 15:21:41 +00:00