Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/libhack libhack: build with -D_REENTRANT



details:   https://anonhg.NetBSD.org/src/rev/002cc8a16554
branches:  trunk
changeset: 1007839:002cc8a16554
user:      roy <roy%NetBSD.org@localhost>
date:      Sun Mar 01 22:47:26 2020 +0000

description:
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.

diffstat:

 distrib/utils/libhack/Makefile.inc |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 206f593e4d72 -r 002cc8a16554 distrib/utils/libhack/Makefile.inc
--- a/distrib/utils/libhack/Makefile.inc        Sun Mar 01 22:08:17 2020 +0000
+++ b/distrib/utils/libhack/Makefile.inc        Sun Mar 01 22:47:26 2020 +0000
@@ -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 \



Home | Main Index | Thread Index | Old Index