You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

  1. #!/usr/bin/env bash
  2. # Install a newer CMake version
  3. curl -sSL https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.sh -o install-cmake.sh
  4. chmod +x install-cmake.sh
  5. sudo ./install-cmake.sh --prefix=/usr/local --skip-license
  6. # Checkout LLVM sources
  7. git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source
  8. git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx
  9. git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi
  10. # Setup libc++ options
  11. if [ -z "$BUILD_32_BITS" ]; then
  12. export BUILD_32_BITS=OFF && echo disabling 32 bit build
  13. fi
  14. # Build and install libc++ (Use unstable ABI for better sanitizer coverage)
  15. mkdir llvm-build && cd llvm-build
  16. cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
  17. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \
  18. -DLIBCXX_ABI_UNSTABLE=ON \
  19. -DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
  20. -DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
  21. ../llvm-source
  22. make cxx -j2
  23. sudo make install-cxxabi install-cxx
  24. cd ../