From 954728e9df0ea4e1e79f9342d89e0fafc28f2cad Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 12 Feb 2019 12:45:01 -0700 Subject: [PATCH] build: Support PGO on clang. Change-Id: I837c6c35c7ab34f5610d782647e333db2aff1f63 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/444279 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index dee62f580..bc506acd1 100755 --- a/configure +++ b/configure @@ -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