From 4bd96a61f103ac7ed8b52d39e99424f2f9b52643 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Thu, 6 Jan 2022 00:20:49 -0500 Subject: [PATCH] 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. --- programs/benchzstd.c | 5 +++++ 1 file changed, 5 insertions(+) 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" -- 2.47.2