35
35
# that's per-target so you're allowed to conditionally add files based on the
36
36
# target.
37
37
# ###############################################################################
38
- NATIVE_LIBS := rust_builtin hoedown miniz rust_test_helpers
38
+ NATIVE_LIBS := hoedown miniz rust_test_helpers
39
39
40
40
# $(1) is the target triple
41
41
define NATIVE_LIBRARIES
@@ -50,8 +50,6 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
50
50
hoedown/src/stack.c \
51
51
hoedown/src/version.c
52
52
NATIVE_DEPS_miniz_$(1 ) = miniz.c
53
- NATIVE_DEPS_rust_builtin_$(1 ) := rust_builtin.c \
54
- rust_android_dummy.c
55
53
NATIVE_DEPS_rust_test_helpers_$(1 ) := rust_test_helpers.c
56
54
57
55
# ###############################################################################
@@ -128,12 +126,25 @@ define DEF_THIRD_PARTY_TARGETS
128
126
129
127
# $(1) is the target triple
130
128
131
- ifeq ($$(CFG_WINDOWSY_$(1 ) ) , 1)
132
- # This isn't necessarily a desired option, but it's harmless and works around
133
- # what appears to be a mingw-w64 bug.
129
+ ifeq ($$(CFG_WINDOWSY_$(1 ) ) ,1)
130
+ # A bit of history here, this used to be --enable-lazy-lock added in #14006
131
+ # which was filed with jemalloc in jemalloc/jemalloc#83 which was also
132
+ # reported to MinGW: http://sourceforge.net/p/mingw-w64/bugs/395/
133
+ #
134
+ # When updating jemalloc to 4.0, however, it was found that binaries would
135
+ # exit with the status code STATUS_RESOURCE_NOT_OWNED indicating that a thread
136
+ # was unlocking a mutex it never locked. Disabling this "lazy lock" option
137
+ # seems to fix the issue, but it was enabled by default for MinGW targets in
138
+ # 13473c7 for jemalloc.
139
+ #
140
+ # As a result of all that, force disabling lazy lock on Windows, and after
141
+ # reading some code it at least *appears* that the initialization of mutexes
142
+ # is otherwise ok in jemalloc, so shouldn't cause problems hopefully...
134
143
#
135
- # https://sourceforge.net/p/mingw-w64/bugs/395/
136
- JEMALLOC_ARGS_$(1) := --enable-lazy-lock
144
+ # tl;dr: make windows behave like other platforms by disabling lazy locking,
145
+ # but requires passing an option due to a historical default with
146
+ # jemalloc.
147
+ JEMALLOC_ARGS_$(1) := --disable-lazy-lock
137
148
else ifeq ($(OSTYPE_$(1)), apple-ios)
138
149
JEMALLOC_ARGS_$(1) := --disable-tls
139
150
else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
0 commit comments