build: Support PGO on clang.

Change-Id: I837c6c35c7ab34f5610d782647e333db2aff1f63
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/444279
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2019-02-12 12:45:01 -07:00 committed by Darek Stojaczyk
parent 5a670e8e76
commit 954728e9df

7
configure vendored
View File

@ -490,6 +490,13 @@ fi
if [[ "${CONFIG[PGO_CAPTURE]}" = "y" && "${CONFIG[PGO_USE]}" = "y" ]]; then
echo "ERROR: --enable-pgo-capture and --enable-pgo-use are mutually exclusive."
exit 1
elif [[ "${CONFIG[PGO_USE]}" = "y" ]]; then
CC_TYPE=$($rootdir/scripts/detect_cc.sh --cc=$CC --cxx=$CXX --lto=$CONFIG[LTO] --ld=$LD | grep "CC_TYPE" | cut -d "=" -f 2)
if [[ "$CC_TYPE" = "clang" ]]; then
# For clang we need to run an extra step on gathered profiling data.
echo "Generating suitable profile data"
llvm-profdata merge -output=build/pgo/default.profdata build/pgo
fi
fi