-
Notifications
You must be signed in to change notification settings - Fork 440
Compiling Chrome using flto
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH="$PATH:/path/to/depot_tools"
$ mkdir ~/chromium
$ cd ~/chromium
$ fetch --nohooks chromium
$ cd src
$ build/install-build-deps.sh
$ gclient runhooks
(clang-4.0.0 does not accept these options)
"-Wno-unused-lambda-capture" and "-Wno-enum-compare-switch" in file build/config/compiler/BUILD.gn
ldflags += [ "-nostdlib++" ] in file build/config/posix/BUILD.gn
$ gn args out/Default
This will bring up an editor (vi/vim). Enter the following options:
is_debug = false
is_component_build = true
symbol_level = 0
enable_nacl = false
clang_base_path = "HOME_TO_LLVM_BUILD"
clang_use_chrome_plugins = false
clang_version = "LOCAL_CLANG_VERSION"
Then save and quit the editor (:wq). "Default" can be replaced by any other name.
Edit file "out/Default/toolchain.ninja" to add options for "lto" (add -flto before "cflags" and "ldflags")
ninja -j 8 -C out/Default chrome
dromaeo http://dromaeo.com/
jetstream http://browserbench.org/JetStream/
kraken http://krakenbenchmark.mozilla.org/
litebrite https://testdrive-archive.azurewebsites.net/Performance/LiteBrite/
octane https://developers.google.com/octane/
peacekeeper http://peacekeeper.futuremark.com/
sunspider https://webkit.org/perf/sunspider/sunspider.html
wirple-bmark https://www.wirple.com/bmark/