1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 09:07:10 +03:00

Do not use mimalloc when building on Android as it causes a infinite recursuion.

Signed-off-by: Benjamin Thaut <code@benjamin-thaut.de>
This commit is contained in:
Benjamin Thaut 2021-12-27 17:13:25 +01:00
parent 5c35d2a41f
commit f943da88d7

View File

@ -16,6 +16,7 @@ endif
STRIP ?= strip
OS ?= $(shell uname -s)
OS2 ?= $(shell uname -o)
# Used for both C and C++
COMMON_FLAGS = -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables
@ -58,15 +59,17 @@ else ifeq ($(TSAN), 1)
CXXFLAGS += -fsanitize=thread
LDFLAGS += -fsanitize=thread
else ifneq ($(OS), Darwin)
# By default, we want to use mimalloc as a memory allocator.
# Since replacing the standard malloc is not compatible with ASAN,
# we do that only when ASAN is not enabled.
ifdef SYSTEM_MIMALLOC
LIBS += -lmimalloc
else
MIMALLOC_LIB = out/mimalloc/libmimalloc.a
CPPFLAGS += -Ithird-party/mimalloc/include
LIBS += -Wl,-whole-archive $(MIMALLOC_LIB) -Wl,-no-whole-archive
ifneq ($(OS2), Android)
# By default, we want to use mimalloc as a memory allocator.
# Since replacing the standard malloc is not compatible with ASAN,
# we do that only when ASAN is not enabled.
ifdef SYSTEM_MIMALLOC
LIBS += -lmimalloc
else
MIMALLOC_LIB = out/mimalloc/libmimalloc.a
CPPFLAGS += -Ithird-party/mimalloc/include
LIBS += -Wl,-whole-archive $(MIMALLOC_LIB) -Wl,-no-whole-archive
endif
endif
endif