]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Avoid xxHash Dependency by Inlining 2977/head
authorW. Felix Handte <w@felixhandte.com>
Thu, 6 Jan 2022 05:20:49 +0000 (00:20 -0500)
committerW. Felix Handte <w@felixhandte.com>
Thu, 6 Jan 2022 05:25:26 +0000 (00:25 -0500)
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

index 1e4d717d15352439c15b4170ddd9f06af6bdcf29..fa2659efbbba3dad002549ea1dbaf05438c309e7 100644 (file)
 #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"