1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-11 05:46:58 +03:00

Do not set a variable instead of undefine it later

This commit is contained in:
Rui Ueyama 2021-07-01 10:38:30 +09:00
parent 4efc795520
commit 18156f3965

View File

@ -1,7 +1,6 @@
CC = clang
CXX = clang++
MIMALLOC_LIB = mimalloc/out/release/libmimalloc.a
GIT_HASH ?= $(shell [ -d .git ] && git rev-parse HEAD)
CPPFLAGS = -g -Imimalloc/include -pthread -std=c++20 \
@ -41,10 +40,11 @@ else
# 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.
ifndef SYSTEM_MIMALLOC
LIBS += -Wl,-whole-archive $(MIMALLOC_LIB) -Wl,-no-whole-archive
else
ifdef SYSTEM_MIMALLOC
LIBS += -lmimalloc
else
MIMALLOC_LIB = mimalloc/out/release/libmimalloc.a
LIBS += -Wl,-whole-archive $(MIMALLOC_LIB) -Wl,-no-whole-archive
endif
endif
@ -55,10 +55,6 @@ endif
all: mold mold-wrapper.so
ifdef SYSTEM_MIMALLOC
undefine MIMALLOC_LIB
endif
mold: $(OBJS) $(MIMALLOC_LIB)
$(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)