summaryrefslogtreecommitdiff
path: root/external/bsd/jemalloc
diff options
context:
space:
mode:
authorrin <rin@NetBSD.org>2019-11-01 20:53:10 +0000
committerrin <rin@NetBSD.org>2019-11-01 20:53:10 +0000
commit8658cdcfe1c9156f0be459841fb6575e0bb3536d (patch)
tree7e34c00df5a17a78e5e30437845dcbd6cb75f1e3 /external/bsd/jemalloc
parent9115966ab5874ac332994c53308777853497fad9 (diff)
Workaround for random crash of userland binaries, as reported in
PR port-alpha/54307. If rtree.c and tcache.c are compiled with -O0, userland just works without problems as far as I can see. Alternately, you can specify -DJEMALLOC_DEBUG to avoid random crash. Smells like compiler bug, or wrong coding which relies on some undefined behavior. Anyway, we need to pull this up into netbsd-9 asap.
Diffstat (limited to 'external/bsd/jemalloc')
-rw-r--r--external/bsd/jemalloc/lib/Makefile.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/external/bsd/jemalloc/lib/Makefile.inc b/external/bsd/jemalloc/lib/Makefile.inc
index 464b8a4b4ed..55cd56329eb 100644
--- a/external/bsd/jemalloc/lib/Makefile.inc
+++ b/external/bsd/jemalloc/lib/Makefile.inc
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.10 2019/07/23 06:31:20 martin Exp $
+# $NetBSD: Makefile.inc,v 1.11 2019/11/01 20:53:10 rin Exp $
JEMALLOC:=${.PARSEDIR}/..
@@ -51,6 +51,14 @@ COPTS.ctl.c+=-Wno-error=stack-protector
COPTS.stats.c+=-Wno-error=stack-protector
COPTS.tcache.c+=-Wno-error=stack-protector
+.if ${MACHINE} == "alpha"
+# These files need to be compiled with -O0, or build everything with
+# -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
+# reported in port-alpha/54307.
+COPTS.rtree.c+=-O0
+COPTS.tcache.c+=-O0
+.endif
+
.if ${MACHINE_ARCH} == "vax"
# in merge_overlapping_regs, at regrename.c
COPTS.arena.c+=-O0