Skip to content

"make zstd-pgo" doesn't work #329

@octoploid

Description

@octoploid
markus@x4 programs % ZSTD_LEGACY_SUPPORT=0 make zstd-pgo
make -C ../lib clean
make[1]: Entering directory '/var/tmp/zstd/lib'
Cleaning library completed
make[1]: Leaving directory '/var/tmp/zstd/lib'
Cleaning completed
cc    -falign-loops=32 -I../lib -I../lib/common -I../lib/dictBuilder -DZSTD_LEGACY_SUPPORT=0 -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -fprofile-generate  -DZSTD_LEGACY_SUPPORT=0 ../lib/decompress/zstd_decompress.c -c -o ../lib/decompress/zstd_decompress.o
cc      -I../lib -I../lib/common -I../lib/dictBuilder -DZSTD_LEGACY_SUPPORT=0 -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -fprofile-generate  -DZSTD_LEGACY_SUPPORT=0 ../lib/decompress/zstd_decompress.o ../lib/decompress/huf_decompress.c ../lib/common/entropy_common.c ../lib/common/xxhash.c ../lib/common/fse_decompress.c ../lib/common/zstd_common.c ../lib/compress/zstd_compress.c ../lib/compress/fse_compress.c ../lib/compress/huf_compress.c ../lib/dictBuilder/divsufsort.c ../lib/dictBuilder/zdict.c zstdcli.c fileio.c bench.c datagen.c dibio.c -o zstd
./zstd -b19i1 
19#Synthetic 50%     :  10000000 ->   3108159 (3.217),   2.0 MB/s , 610.9 MB/s 
./zstd -b16i1 
16#Synthetic 50%     :  10000000 ->   3363862 (2.973),   6.3 MB/s , 318.1 MB/s 
./zstd -b9i2 
 9#Synthetic 50%     :  10000000 ->   3315475 (3.016),  13.7 MB/s , 379.8 MB/s 
./zstd -b 
 3#Synthetic 50%     :  10000000 ->   3225549 (3.100),  47.5 MB/s , 554.7 MB/s 
./zstd -b7i2 
 7#Synthetic 50%     :  10000000 ->   3321301 (3.011),  26.3 MB/s , 392.3 MB/s 
./zstd -b5 
 5#Synthetic 50%     :  10000000 ->   3266969 (3.061),  32.7 MB/s , 460.5 MB/s 
rm -f zstd
make zstd MOREFLAGS=-fprofile-use
make[1]: Entering directory '/var/tmp/zstd/programs'
cc      -I../lib -I../lib/common -I../lib/dictBuilder -DZSTD_LEGACY_SUPPORT=0 -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -fprofile-use  -DZSTD_LEGACY_SUPPORT=0 ../lib/decompress/zstd_decompress.o ../lib/decompress/huf_decompress.c ../lib/common/entropy_common.c ../lib/common/xxhash.c ../lib/common/fse_decompress.c ../lib/common/zstd_common.c ../lib/compress/zstd_compress.c ../lib/compress/fse_compress.c ../lib/compress/huf_compress.c ../lib/dictBuilder/divsufsort.c ../lib/dictBuilder/zdict.c zstdcli.c fileio.c bench.c datagen.c dibio.c -o zstd
../lib/decompress/zstd_decompress.o:zstd_decompress.c:function ZSTD_sizeof_DStream: error: undefined reference to '__gcov_indirect_call_profiler_v2'
../lib/decompress/zstd_decompress.o:zstd_decompress.c:function ZSTD_sizeof_DStream: error: undefined reference to '__gcov_indirect_call_callee'
../lib/decompress/zstd_decompress.o:zstd_decompress.c:function ZSTD_sizeof_DStream: error: undefined reference to '__gcov_time_profiler'
...

The fix is simple:

diff --git a/programs/Makefile b/programs/Makefile
index fc634b60edfc..2e38837d429b 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -97,6 +97,7 @@ zstd-pgo : clean zstd
        ./zstd -b7i2 $(PROFILE_WITH)
        ./zstd -b5 $(PROFILE_WITH)
        $(RM) zstd
+       $(RM) ../lib/decompress/zstd_decompress.o
        $(MAKE) zstd MOREFLAGS=-fprofile-use

 zstd-frugal: $(ZSTDDECOMP_O) $(ZSTD_FILES) zstdcli.c fileio.c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions