Created
August 21, 2022 01:29
-
-
Save pr0cf5/066e3e81328846ae9b20aef3f4a77e0c to your computer and use it in GitHub Desktop.
Revisions
-
pr0cf5 created this gist
Aug 21, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ # Chromium Let's assume we're trying to build chromium with `sancov`. Although this is possible purely with `gn` arguments, I'll demonstrate this with system toolchain. First, create a file at `out/sancov/args.gn`. The contents of the file should be as follows: ``` custom_toolchain="//build/toolchain/linux/unbundle:default" host_toolchain="//build/toolchain/linux/unbundle:default" is_clang = true clang_use_chrome_plugins = false ``` Second, execute the following commands. ```bash export LLVM_BIN_DIR="/usr/local/bin" export CC="$LLVM_BIN_DIR/clang" export CXX="$LLVM_BIN_DIR/clang++" export AR="$LLVM_BIN_DIR/llvm-ar" export SOLINK="$LLVM_BIN_DIR/lld" export NM="$LLVM_BIN_DIR/llvm-nm" export LDFLAGS="-fsanitize-coverage=trace-pc-guard" gn gen out/sancov autoninja -C out/sancov chrome ```