]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
programs/Makefile: make it actually work with clang 2125/head
authorMingye Wang <arthur200126@gmail.com>
Sun, 10 May 2020 08:36:08 +0000 (16:36 +0800)
committerGitHub <noreply@github.com>
Sun, 10 May 2020 08:36:08 +0000 (16:36 +0800)
Recent versions of clang seem to require a step of conversion from the profraw file to a "compiler-readable" profdata file to let PGO work.

programs/Makefile

index 1a85f185e5c17b239fc09920ef1546d1fb6c9205..8ef53a01755854d567cb001fff442fdc999c16b4 100644 (file)
@@ -237,6 +237,7 @@ zstd-pgo :
        ./zstd -b7i2 $(PROFILE_WITH)
        ./zstd -b5 $(PROFILE_WITH)
        $(RM) zstd *.o $(ZSTDDECOMP_O) $(ZSTDDIR)/compress/*.o
+       case $(CC) in *clang*) if ! [ -e default.profdata ]; then llvm-profdata merge -output=default.profdata default*.profraw; fi ;; esac
        $(MAKE) zstd MOREFLAGS=-fprofile-use
 
 ## zstd-small: minimal target, supporting only zstd compression and decompression. no bench. no legacy. no other format.
@@ -277,7 +278,7 @@ clean:
        @$(RM) core *.o tmp* result* *.gcda dictionary *.zst \
         zstd$(EXT) zstd32$(EXT) zstd-compress$(EXT) zstd-decompress$(EXT) \
         zstd-small$(EXT) zstd-frugal$(EXT) zstd-nolegacy$(EXT) zstd4$(EXT) \
-        zstd-dictBuilder$(EXT) *.gcda default.profraw have_zlib$(EXT)
+        zstd-dictBuilder$(EXT) *.gcda default*.profraw default.profdata have_zlib$(EXT)
        @echo Cleaning completed
 
 MD2ROFF = ronn