From 928cfecf9db64b92d32dcdf60b267393324d7b5a Mon Sep 17 00:00:00 2001 From: "zongmin.gu" Date: Mon, 23 Nov 2020 18:35:13 +0800 Subject: [PATCH] Change Tcmalloc as optional feature The current Tcmalloc has memory leak issue. So change it as optional. By default, dlmalloc is used. Enable tcmalloc with below command: make TCMALLOC=Y --- src/sgxenv.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sgxenv.mk b/src/sgxenv.mk index 73859d02..60c925ea 100644 --- a/src/sgxenv.mk +++ b/src/sgxenv.mk @@ -132,10 +132,9 @@ SGX_CXXFLAGS_T := $(SGX_CFLAGS_T) -std=c++11 -nostdinc++ -I$(SGX_SDK)/include/li # linked. SGX_LFLAGS_T = $(SGX_COMMON_CFLAGS) -nostdlib -L$(SGX_LIBRARY_PATH) $(_Other_Link_Flags) \ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -ifeq ($(SGX_MODE), HW) +ifeq ($(TCMALLOC), Y) SGX_LFLAGS_T += -Wl,--whole-archive -lsgx_tcmalloc -Wl,--no-whole-archive endif - SGX_LFLAGS_T += -Wl,--start-group -lsgx_tcxx -lsgx_tstdc -l$(Crypto_Library_Name) -l$(Service_Library_Name) $(_Other_Enclave_Libs) -Wl,--end-group \ -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \ -Wl,-pie,-eenclave_entry -Wl,--export-dynamic \