2022-09-04 20:57:16 +00:00
|
|
|
From cb62c8b3cc981cbffa3b151d15961573c71fac51 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <cb62c8b3cc981cbffa3b151d15961573c71fac51.1662274415.git.github@sicherha.de>
|
2022-08-18 12:37:59 +00:00
|
|
|
From: Christoph Erhardt <github@sicherha.de>
|
|
|
|
Date: Sat, 6 Aug 2022 09:18:54 +0200
|
|
|
|
Subject: [PATCH] Use system-compatible include path for `xxhash.h`
|
|
|
|
|
|
|
|
Distributors that build mold against the system-provided xxHash package
|
|
|
|
expect its header file `xxhash.h` in the top-level include directory,
|
|
|
|
not in an `xxhash` subdirectory. Adjust the include path and the
|
|
|
|
`#include` directive accordingly.
|
|
|
|
---
|
|
|
|
Makefile | 1 +
|
|
|
|
mold.h | 2 +-
|
|
|
|
2 files changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/Makefile b/Makefile
|
2022-09-04 20:57:16 +00:00
|
|
|
index d3f47801..59943a9c 100644
|
2022-08-18 12:37:59 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
|
|
|
@@ -47,6 +47,7 @@ CXXFLAGS = -O2
|
|
|
|
|
|
|
|
MOLD_CXXFLAGS := -std=c++20 -fno-exceptions -fno-unwind-tables \
|
|
|
|
-fno-asynchronous-unwind-tables \
|
|
|
|
+ -Ithird-party -Ithird-party/xxhash \
|
|
|
|
-DMOLD_VERSION=\"$(VERSION)\" -DLIBDIR="\"$(LIBDIR)\""
|
|
|
|
|
2022-09-04 20:57:16 +00:00
|
|
|
ifeq ($(OS), OpenBSD)
|
2022-08-18 12:37:59 +00:00
|
|
|
diff --git a/mold.h b/mold.h
|
2022-09-04 20:57:16 +00:00
|
|
|
index 94ef8226..9f857534 100644
|
2022-08-18 12:37:59 +00:00
|
|
|
--- a/mold.h
|
|
|
|
+++ b/mold.h
|
|
|
|
@@ -32,7 +32,7 @@
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define XXH_INLINE_ALL 1
|
|
|
|
-#include "third-party/xxhash/xxhash.h"
|
|
|
|
+#include <xxhash.h>
|
|
|
|
|
2022-09-04 20:57:16 +00:00
|
|
|
#ifdef NDEBUG
|
|
|
|
# define unreachable() __builtin_unreachable()
|
2022-08-18 12:37:59 +00:00
|
|
|
--
|
|
|
|
2.37.2
|
|
|
|
|