From e9ff6f6092e6128393ff2b2b9e1a51853f15dcde Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 29 Aug 2020 22:07:27 +0800 Subject: [PATCH] Add PGO build for Win and Mac --- src/build.sh | 14 ++++++++++++++ src/get-clang.sh | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/build.sh b/src/build.sh index dc4d1c56a8..55db8a481f 100755 --- a/src/build.sh +++ b/src/build.sh @@ -82,6 +82,20 @@ if [ "$(uname)" = Linux ]; then fi fi +case "$(uname)" in + MINGW*|MSYS*) + case "$(uname -m)" in + x86_64) PGO_NAME=win64;; + *) PGO_NAME=win32;; + esac;; + Darwin) PGO_NAME=mac;; +esac +if [ "$PGO_NAME" ]; then + profile=$(cat chrome/build/$PGO_NAME.pgo.txt) + flags="$flags + pgo_data_path=\"../../chrome/build/pgo_profiles/$profile\"" +fi + rm -rf "./$out" mkdir -p out diff --git a/src/get-clang.sh b/src/get-clang.sh index 37be25bf18..f3d6321063 100755 --- a/src/get-clang.sh +++ b/src/get-clang.sh @@ -47,6 +47,23 @@ if [ "$ARCH" = Linux -a ! -f chrome/android/profiles/afdo.prof ]; then curl "$afdo_url" | bzip2 -cd >chrome/android/profiles/afdo.prof fi +# Profiles (Windows, Mac) +case "$ARCH" in + Windows) + case "$(uname -m)" in + x86_64) PGO_NAME=win64;; + *) PGO_NAME=win32;; + esac;; + Darwin) PGO_NAME=mac;; +esac +if [ "$PGO_NAME" ]; then + mkdir -p chrome/build/pgo_profiles + profile=$(cat chrome/build/$PGO_NAME.pgo.txt) + cd chrome/build/pgo_profiles + curl -LO "https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles/$profile" + cd ../../.. +fi + # dsymutil (Mac) if [ "$ARCH" = Darwin ]; then mkdir -p tools/clang/dsymutil