1*d89ec533Spatrick.. _BuildingCompilerRT: 2*d89ec533Spatrick 3*d89ec533Spatrick=============== 4*d89ec533SpatrickBuilding Compiler-RT 5*d89ec533Spatrick=============== 6*d89ec533Spatrick 7*d89ec533Spatrick.. contents:: 8*d89ec533Spatrick :local: 9*d89ec533Spatrick 10*d89ec533Spatrick.. _build instructions: 11*d89ec533Spatrick 12*d89ec533SpatrickThe instructions on this page are aimed at vendors who ship Compiler-RT as part of an 13*d89ec533Spatrickoperating system distribution, a toolchain or similar shipping vehicules. If you 14*d89ec533Spatrickare a user merely trying to use Compiler-RT in your program, you most likely want to 15*d89ec533Spatrickrefer to your vendor's documentation, or to the general documentation for using 16*d89ec533SpatrickLLVM, Clang, the various santizers, etc. 17*d89ec533Spatrick 18*d89ec533SpatrickCMake Options 19*d89ec533Spatrick============= 20*d89ec533Spatrick 21*d89ec533SpatrickHere are some of the CMake variables that are used often, along with a 22*d89ec533Spatrickbrief explanation and LLVM-specific notes. For full documentation, check the 23*d89ec533SpatrickCMake docs or execute ``cmake --help-variable VARIABLE_NAME``. 24*d89ec533Spatrick 25*d89ec533Spatrick**CMAKE_BUILD_TYPE**:STRING 26*d89ec533Spatrick Sets the build type for ``make`` based generators. Possible values are 27*d89ec533Spatrick Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio 28*d89ec533Spatrick the user sets the build type with the IDE settings. 29*d89ec533Spatrick 30*d89ec533Spatrick**CMAKE_INSTALL_PREFIX**:PATH 31*d89ec533Spatrick Path where LLVM will be installed if "make install" is invoked or the 32*d89ec533Spatrick "INSTALL" target is built. 33*d89ec533Spatrick 34*d89ec533Spatrick**CMAKE_CXX_COMPILER**:STRING 35*d89ec533Spatrick The C++ compiler to use when building and testing Compiler-RT. 36*d89ec533Spatrick 37*d89ec533Spatrick 38*d89ec533Spatrick.. _compiler-rt-specific options: 39*d89ec533Spatrick 40*d89ec533SpatrickCompiler-RT specific options 41*d89ec533Spatrick----------------------- 42*d89ec533Spatrick 43*d89ec533Spatrick.. option:: COMPILER_RT_INSTALL_PATH:PATH 44*d89ec533Spatrick 45*d89ec533Spatrick **Default**: ```` (empty relative path) 46*d89ec533Spatrick 47*d89ec533Spatrick Prefix for directories where built Compiler-RT artifacts should be installed. 48*d89ec533Spatrick Can be an absolute path, like the default empty string, in which case it is 49*d89ec533Spatrick relative ``CMAKE_INSTALL_PREFIX``. If setting a relative path, make sure to 50*d89ec533Spatrick include the ``:PATH`` with your ``-D``, i.e. use 51*d89ec533Spatrick ``-DCOMPILER_RT_INSTALL_PATH:PATH=...`` not 52*d89ec533Spatrick ``-DCOMPILER_RT_INSTALL_PATH=...``, otherwise CMake will convert the 53*d89ec533Spatrick path to an absolute path. 54*d89ec533Spatrick 55*d89ec533Spatrick.. option:: COMPILER_RT_INSTALL_LIBRARY_DIR:PATH 56*d89ec533Spatrick 57*d89ec533Spatrick **Default**: ``lib`` 58*d89ec533Spatrick 59*d89ec533Spatrick Path where built Compiler-RT libraries should be installed. If a relative 60*d89ec533Spatrick path, relative to ``COMPILER_RT_INSTALL_PATH``. 61*d89ec533Spatrick 62*d89ec533Spatrick.. option:: COMPILER_RT_INSTALL_BINARY_DIR:PATH 63*d89ec533Spatrick 64*d89ec533Spatrick **Default**: ``bin`` 65*d89ec533Spatrick 66*d89ec533Spatrick Path where built Compiler-RT executables should be installed. If a relative 67*d89ec533Spatrick path, relative to ``COMPILER_RT_INSTALL_PATH``. 68*d89ec533Spatrick 69*d89ec533Spatrick.. option:: COMPILER_RT_INSTALL_INCLUDE_DIR:PATH 70*d89ec533Spatrick 71*d89ec533Spatrick **Default**: ``include`` 72*d89ec533Spatrick 73*d89ec533Spatrick Path where Compiler-RT headers should be installed. If a relative 74*d89ec533Spatrick path, relative to ``COMPILER_RT_INSTALL_PATH``. 75*d89ec533Spatrick 76*d89ec533Spatrick.. option:: COMPILER_RT_INSTALL_DATA_DIR:PATH 77*d89ec533Spatrick 78*d89ec533Spatrick **Default**: ``share`` 79*d89ec533Spatrick 80*d89ec533Spatrick Path where Compiler-RT data should be installed. If a relative 81*d89ec533Spatrick path, relative to ``COMPILER_RT_INSTALL_PATH``. 82*d89ec533Spatrick 83*d89ec533Spatrick.. _LLVM-specific variables: 84*d89ec533Spatrick 85*d89ec533SpatrickLLVM-specific options 86*d89ec533Spatrick--------------------- 87*d89ec533Spatrick 88*d89ec533Spatrick.. option:: LLVM_LIBDIR_SUFFIX:STRING 89*d89ec533Spatrick 90*d89ec533Spatrick Extra suffix to append to the directory where libraries are to be 91*d89ec533Spatrick installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` 92*d89ec533Spatrick to install libraries to ``/usr/lib64``. 93