From: W. Felix Handte Date: Thu, 6 Jan 2022 05:20:49 +0000 (-0500) Subject: Avoid xxHash Dependency by Inlining X-Git-Tag: v1.5.2^2~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2977%2Fhead;p=thirdparty%2Fzstd.git Avoid xxHash Dependency by Inlining xxHash symbols are present in `libzstd.so`, but they are local and therefore unavailable outside the lib. There are two possible solutions to the problem. We could make those symbols global, or we could remove the dependency. This commit chooses the latter approach. I suppose this comes at the cost of code size / build time. I'm open to comments on whether this is a good thing to do, especially since this will apply even when we are statically linking everything. --- diff --git a/programs/benchzstd.c b/programs/benchzstd.c index 1e4d717d1..fa2659efb 100644 --- a/programs/benchzstd.c +++ b/programs/benchzstd.c @@ -31,9 +31,14 @@ #include "timefn.h" /* UTIL_time_t */ #include "benchfn.h" #include "../lib/common/mem.h" +#ifndef ZSTD_STATIC_LINKING_ONLY #define ZSTD_STATIC_LINKING_ONLY +#endif #include "../lib/zstd.h" #include "datagen.h" /* RDG_genBuffer */ +#ifndef XXH_INLINE_ALL +#define XXH_INLINE_ALL +#endif #include "../lib/common/xxhash.h" #include "benchzstd.h" #include "../lib/zstd_errors.h"