[XRay] Clean up XRay build configuration
authorDean Michael Berris <dberris@google.com>
Mon, 24 Sep 2018 05:28:01 +0000 (05:28 +0000)
committerDean Michael Berris <dberris@google.com>
Mon, 24 Sep 2018 05:28:01 +0000 (05:28 +0000)
commitf578aaa0586dcc2a259a7e2556c6da9ee01b8b0b
treefd3ed019b72922f7bf564bf80aebe339c0edaef6
parent9a71e8064581ed8567c8bad52a27fd5ad410e6d8
[XRay] Clean up XRay build configuration

Summary:
This change spans both LLVM and compiler-rt, where we do the following:

- Add XRay to the LLVMBuild system, to allow for distributing the XRay
  trace loading library along with the LLVM distributions.

- Use `llvm-config` better in the compiler-rt XRay implementation, to
  depend on the potentially already-distributed LLVM XRay library.

While this is tested with the standalone compiler-rt build, it does
require that the LLVMXRay library (and LLVMSupport as well) are
available during the build. In case the static libraries are available,
the unit tests will build and work fine. We're still having issues with
attempting to use a shared library version of the LLVMXRay library since
the shared library might not be accessible from the standard shared
library lookup paths.

The larger change here is the inclusion of the LLVMXRay library in the
distribution, which allows for building tools around the XRay traces and
profiles that the XRay runtime already generates.

Reviewers: echristo, beanz

Subscribers: mgorny, hiraditya, mboerger, llvm-commits

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

llvm-svn: 342859
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/lib/xray/tests/CMakeLists.txt
compiler-rt/lib/xray/tests/unit/CMakeLists.txt
llvm/lib/LLVMBuild.txt
llvm/lib/XRay/LLVMBuild.txt [new file with mode: 0644]