Skip to content

Commit 98a30ac

Browse files
committed
libcxxabi patch: respect NDEBUG
zig patch: respect NDEBUG. Otherwise the file path makes it into the binary, causing non-reproducible builds.
1 parent cd1ddca commit 98a30ac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/libcxxabi/src/abort_message.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ extern "C" _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void
1515
abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
1616

1717
#ifndef _LIBCXXABI_ASSERT
18+
// zig patch: respect NDEBUG. Otherwise the file path makes it into the binary,
19+
// causing non-reproducible builds.
20+
#ifdef NDEBUG
21+
#define _LIBCXXABI_ASSERT(a,b) (void)0
22+
#else
1823
# define _LIBCXXABI_ASSERT(expr, msg) \
1924
do { \
2025
if (!(expr)) { \
@@ -24,5 +29,6 @@ abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
2429
} while (false)
2530

2631
#endif
32+
#endif
2733

2834
#endif // __ABORT_MESSAGE_H_

0 commit comments

Comments
 (0)