• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1MSAN, ASAN, & TSAN
2==================
3
4*Testing Skia with memory, address, and thread santizers.*
5
6Downloading Clang Binaries (Googlers Only)
7------------------------------------------
8
9    CLANGDIR="${HOME}/clang"
10    python infra/bots/assets/clang_linux/download.py -t $CLANGDIR
11
12Building Clang from scratch
13---------------------------
14
15    CLANGDIR="${HOME}/clang"
16
17    python tools/git-sync-deps
18    CC= CXX= infra/bots/assets/clang_linux/create.py -t "$CLANGDIR"
19
20Configure and Compile Skia with MSAN
21------------------------------------
22
23    CLANGDIR="${HOME}/clang"
24    mkdir -p out/msan
25    cat > out/msan/args.gn <<- EOF
26        cc = "${CLANGDIR}/bin/clang"
27        cxx = "${CLANGDIR}/bin/clang++"
28        extra_cflags = [ "-B${CLANGDIR}/bin" ]
29        extra_ldflags = [ "-B${CLANGDIR}/bin", "-fuse-ld=lld", "-L${CLANGDIR}/msan" ]
30        sanitize = "MSAN"
31        skia_use_fontconfig = false
32    EOF
33    python tools/git-sync-deps
34    bin/gn gen out/msan
35    ninja -C out/msan
36
37When you run a binary built with MSAN, make sure you force it to use our
38MSAN-instrumented libc++:
39
40    env LD_LIBRARY_PATH=$CLANGDIR/msan out/dm ...
41
42Configure and Compile Skia with ASAN
43------------------------------------
44
45    CLANGDIR="${HOME}/clang"
46    mkdir -p out/asan
47    cat > out/asan/args.gn <<- EOF
48        cc = "${CLANGDIR}/bin/clang"
49        cxx = "${CLANGDIR}/bin/clang++"
50        sanitize = "ASAN"
51    EOF
52    python tools/git-sync-deps
53    bin/gn gen out/asan
54    ninja -C out/asan
55
56Configure and Compile Skia with TSAN
57------------------------------------
58
59    CLANGDIR="${HOME}/clang"
60    mkdir -p out/tsan
61    cat > out/tsan/args.gn <<- EOF
62        cc = "${CLANGDIR}/bin/clang"
63        cxx = "${CLANGDIR}/bin/clang++"
64        sanitize = "TSAN"
65        is_debug = false
66    EOF
67    python tools/git-sync-deps
68    bin/gn gen out/tsan
69    ninja -C out/tsan
70
71
72