Prepare Compiler-RT for GnuInstallDirs, matching libcxx

Authored by Ericson2314 on Apr 28 2021, 3:36 PM.


Prepare Compiler-RT for GnuInstallDirs, matching libcxx

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.

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

Differential Revision: https://reviews.llvm.org/D101497