Skip to content

Commit 3e8c130

Browse files
committed
fix debug build configuration and expose memory usage for debug
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent 2bd0a21 commit 3e8c130

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

Makefile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
######## LCP Build Settings ########
2-
ZK_PROVER_CUDA ?= 0
2+
ZK_PROVER_CUDA ?= 0
33
APP_CARGO_FLAGS ?=
4+
CARGO_TARGET := --release
5+
OUTPUT_PATH := release
46

57
######## SGX SDK Settings ########
6-
SGX_SDK ?= /opt/sgxsdk
7-
SGX_MODE ?= HW
8-
SGX_DEBUG ?= 0
8+
SGX_SDK ?= /opt/sgxsdk
9+
SGX_MODE ?= HW
10+
SGX_DEBUG ?= 0
911
SGX_ENCLAVE_CONFIG ?= "enclave/Enclave.config.xml"
10-
SGX_SIGN_KEY ?= "enclave/Enclave_private.pem"
12+
SGX_SIGN_KEY ?= "enclave/Enclave_private.pem"
1113

12-
SGX_COMMON_CFLAGS := -m64
13-
SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
14+
SGX_COMMON_CFLAGS := -m64
15+
SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
1416
SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x64/sgx_sign
15-
SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r
17+
SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r
1618

1719
include buildenv.mk
1820

1921
ifeq ($(SGX_DEBUG), 1)
20-
# we build with cargo --release, even in SGX DEBUG mode
2122
SGX_COMMON_CFLAGS += -O0 -g -ggdb
22-
# cargo sets this automatically, cannot use 'debug'
23-
OUTPUT_PATH := release
24-
CARGO_TARGET := --release
23+
# debug build
24+
CARGO_TARGET :=
25+
OUTPUT_PATH := debug
2526
else
2627
SGX_COMMON_CFLAGS += -O2
27-
OUTPUT_PATH := release
28-
CARGO_TARGET := --release
2928
endif
3029

3130
SGX_COMMON_CFLAGS += -fstack-protector

enclave/Enclave.lds

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ enclave.so
44
g_global_data_sim;
55
g_global_data;
66
enclave_entry;
7+
g_peak_heap_used;
8+
g_peak_rsrv_mem_committed;
79
local:
810
*;
911
};

0 commit comments

Comments
 (0)