Module Name:    src
Committed By:   roy
Date:           Sun Mar  1 22:47:26 UTC 2020

Modified Files:
        src/distrib/utils/libhack: Makefile.inc

Log Message:
libhack: build with -D_REENTRANT

Some tools that use libhack expect thread locking.
An example of this is zpool(8).

Without it, it randomly crashes. As such, force _REENTRANT to avoid
debugging future random crashes from any other applications which
rely on this.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/distrib/utils/libhack/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/libhack/Makefile.inc
diff -u src/distrib/utils/libhack/Makefile.inc:1.32 src/distrib/utils/libhack/Makefile.inc:1.33
--- src/distrib/utils/libhack/Makefile.inc:1.32	Sun Jul 28 10:27:57 2019
+++ src/distrib/utils/libhack/Makefile.inc	Sun Mar  1 22:47:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.32 2019/07/28 10:27:57 martin Exp $
+# $NetBSD: Makefile.inc,v 1.33 2020/03/01 22:47:26 roy Exp $
 #
 # Include this fragment to build libhack.o
 # It is .o and not .a to make sure these are the
@@ -20,6 +20,13 @@
 
 CPPFLAGS+=	-DSMALL
 CPPFLAGS+=	-DLIBHACK
+
+# Build as re-entrant.
+# A few tool using libhack, such as zpool on the ramdisk-zfsroot,
+# expect this and it's simpler just to set it globally rather than
+# debugging why stuff randomly crashes.
+CPPFLAGS+=	-D_REENTRANT
+
 HACKOBJS+=	getcap.o getgrent.o getnet.o getnetgr.o getpwent.o jemalloc.o \
 		localeconv.o multibyte.o perror.o runetable.o setlocale.o \
 		nl_langinfo.o strcasecmp.o \

Reply via email to