skia2/site/dev/testing/xsan.md
Yuqian Li a0dc0143f8 Update MSAN gn args to match our bots
The previous gn args would result in linking errors.

No-Try: true
Docs-Preview: https://skia.org/?cl=60761
Bug: skia:
Change-Id: Ia9e1472080484d29dfbc2f86728f10721c05856c
Reviewed-on: https://skia-review.googlesource.com/60761
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-18 18:19:05 +00:00

1.8 KiB

MSAN, ASAN, & TSAN

Testing Skia with memory, address, and thread santizers.

Downloading Clang Binaries (Googlers Only)

CLANGDIR="${HOME}/clang"
python infra/bots/assets/clang_linux/download.py -t $CLANGDIR

Building Clang from scratch

CLANGDIR="${HOME}/clang"

python tools/git-sync-deps
CC= CXX= infra/bots/assets/clang_linux/create.py -t "$CLANGDIR"

Configure and Compile Skia with MSAN

CLANGDIR="${HOME}/clang"
mkdir -p out/msan
cat > out/msan/args.gn <<- EOF
    cc = "${CLANGDIR}/bin/clang"
    cxx = "${CLANGDIR}/bin/clang++"
    extra_cflags = [ "-B${CLANGDIR}/bin" ]
    extra_ldflags = [ "-B${CLANGDIR}/bin", "-fuse-ld=lld", "-L${CLANGDIR}/msan" ]
    sanitize = "MSAN"
    skia_use_fontconfig = false
EOF
python tools/git-sync-deps
bin/gn gen out/msan
ninja -C out/msan

You may also need to install the following packages to run the MSAN binary

sudo apt-get install libc++dev libc++abi-dev

Configure and Compile Skia with ASAN

CLANGDIR="${HOME}/clang"
mkdir -p out/asan
cat > out/asan/args.gn <<- EOF
    cc = "${CLANGDIR}/bin/clang"
    cxx = "${CLANGDIR}/bin/clang++"
    sanitize = "ASAN"
EOF
python tools/git-sync-deps
bin/gn gen out/asan
ninja -C out/asan

Configure and Compile Skia with TSAN

CLANGDIR="${HOME}/clang"
mkdir -p out/tsan
cat > out/tsan/args.gn <<- EOF
    cc = "${CLANGDIR}/bin/clang"
    cxx = "${CLANGDIR}/bin/clang++"
    sanitize = "TSAN"
    is_debug = false
EOF
python tools/git-sync-deps
bin/gn gen out/tsan
ninja -C out/tsan