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