summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makerules3
-rw-r--r--include/mupdf/fitz/system.h7
2 files changed, 10 insertions, 0 deletions
diff --git a/Makerules b/Makerules
index fa98685a..d75a6115 100644
--- a/Makerules
+++ b/Makerules
@@ -30,6 +30,9 @@ LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "small"
CFLAGS += -pipe -Os -DNDEBUG -fomit-frame-pointer
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
+else ifeq "$(build)" "valgrind"
+CFLAGS += -pipe -O2 -DNDEBUG -DPACIFY_VALGRIND -fno-omit-frame-pointer
+LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "sanitize"
CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index 54e9c877..5d0341b4 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -14,6 +14,13 @@
#endif
#endif
+/* Turn on valgrind pacification in debug builds. */
+#ifndef NDEBUG
+#ifndef PACIFY_VALGRIND
+#define PACIFY_VALGRIND
+#endif
+#endif
+
/*
Include the standard libc headers.
*/