From 98a30acad6f28825cd93a9d478f6f2b84333bcb6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 8 May 2024 16:05:27 -0700 Subject: [PATCH] libcxxabi patch: respect NDEBUG zig patch: respect NDEBUG. Otherwise the file path makes it into the binary, causing non-reproducible builds. --- lib/libcxxabi/src/abort_message.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libcxxabi/src/abort_message.h b/lib/libcxxabi/src/abort_message.h index 9764177780..2cd09db1fb 100644 --- a/lib/libcxxabi/src/abort_message.h +++ b/lib/libcxxabi/src/abort_message.h @@ -15,6 +15,11 @@ extern "C" _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void abort_message(const char *format, ...) __attribute__((format(printf, 1, 2))); #ifndef _LIBCXXABI_ASSERT +// zig patch: respect NDEBUG. Otherwise the file path makes it into the binary, +// causing non-reproducible builds. +#ifdef NDEBUG +#define _LIBCXXABI_ASSERT(a,b) (void)0 +#else # define _LIBCXXABI_ASSERT(expr, msg) \ do { \ if (!(expr)) { \ @@ -24,5 +29,6 @@ abort_message(const char *format, ...) __attribute__((format(printf, 1, 2))); } while (false) #endif +#endif #endif // __ABORT_MESSAGE_H_