Hi here a patch to fix OpenBSD build.

Kind regards.
From e5cddefe558d6f9bbe70128a3ade86a55d92d1b2 Mon Sep 17 00:00:00 2001
From: David Carlier <[email protected]>
Date: Sun, 25 Jul 2021 12:04:06 +0100
Subject: [PATCH] BUILD/MINOR: memprof disable for OpenBSD when set.

Fixing build in case memory profiling is enabled, due to lack of proper api,
 the profiling data will be wrong regardless.
---
 include/haproxy/compat.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h
index 72dc3dc4f..4d463ea0e 100644
--- a/include/haproxy/compat.h
+++ b/include/haproxy/compat.h
@@ -283,6 +283,11 @@ typedef struct { } empty_t;
 #define malloc_usable_size malloc_size
 #endif
 
+/* OpenBSD does not have anything close to malloc_usable_size, thus profiling will be wrong regardless */
+#if defined(USE_MEMORY_PROFILING) && defined(__OpenBSD__)
+#undef USE_MEMORY_PROFILING
+#endif
+
 /* Max number of file descriptors we send in one sendmsg(). Linux seems to be
  * able to send 253 fds per sendmsg(), not sure about the other OSes.
  */
-- 
2.31.1

Reply via email to