Skip to content

Commit 4bd96a6

Browse files
committed
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.
1 parent fc946d1 commit 4bd96a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

programs/benchzstd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@
3131
#include "timefn.h" /* UTIL_time_t */
3232
#include "benchfn.h"
3333
#include "../lib/common/mem.h"
34+
#ifndef ZSTD_STATIC_LINKING_ONLY
3435
#define ZSTD_STATIC_LINKING_ONLY
36+
#endif
3537
#include "../lib/zstd.h"
3638
#include "datagen.h" /* RDG_genBuffer */
39+
#ifndef XXH_INLINE_ALL
40+
#define XXH_INLINE_ALL
41+
#endif
3742
#include "../lib/common/xxhash.h"
3843
#include "benchzstd.h"
3944
#include "../lib/zstd_errors.h"

0 commit comments

Comments
 (0)