013475a272
This adds LLVM, Clang, and compiler-rt (*san tools) to DEPS, then uses them from xsan_build, building them if needed. This is similar to how the CMake bots bootstrap CMake if needed. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1693733003 Review URL: https://codereview.chromium.org/1693733003
43 lines
1020 B
Bash
Executable File
43 lines
1020 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Build Skia with one of Clang's many sanitizers.
|
|
#
|
|
# $ tools/xsan_build {address,thread,undefined,etc.} [any other flags to pass to make...]
|
|
#
|
|
# This script assumes the use of Clang >=3.2.
|
|
#
|
|
# For more information, see:
|
|
# http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
|
|
|
|
set -e
|
|
set -x
|
|
|
|
here=$(cd `dirname $0`; echo `pwd`)
|
|
cores=48
|
|
|
|
echo "Bootstrapping CMake"
|
|
pushd $here/../third_party/externals/cmake
|
|
./bootstrap --parallel=$cores
|
|
make -j $cores cmake
|
|
popd
|
|
|
|
echo "Building Clang"
|
|
pushd $here/../third_party/externals/llvm
|
|
mkdir -p out/
|
|
cd out/
|
|
$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ..
|
|
ninja
|
|
popd
|
|
|
|
export CC=$here/../third_party/externals/llvm/out/bin/clang
|
|
export CXX=$here/../third_party/externals/llvm/out/bin/clang++
|
|
$CC --version
|
|
|
|
if [[ "$1" == "memory" ]]; then
|
|
export GYP_DEFINES="skia_gpu=0 skia_no_fontconfig=1 skia_freetype_static=1 ${GYP_DEFINES}"
|
|
fi
|
|
export GYP_DEFINES="skia_sanitizer=$1 ${GYP_DEFINES}"
|
|
|
|
shift
|
|
make $@
|