diff --git a/Makefile b/Makefile index 656a0217..a60dbf59 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,10 @@ TEST_SRC+=modp_test.cpp TEST_SRC+=ecdsa_test.cpp ecdsa_c_test.cpp TEST_SRC+=mul_test.cpp TEST_SRC+=bint_test.cpp -TEST_SRC+=low_func_test.cpp static_init_test.cpp +TEST_SRC+=low_func_test.cpp +ifneq ($(MCL_USE_GMP),1) + TEST_SRC+=static_init_test.cpp +endif TEST_SRC+=invmod_test.cpp LIB_OBJ=$(OBJ_DIR)/fp.o ifeq ($(MCL_STATIC_CODE),1) diff --git a/common.mk b/common.mk index 7ba5a64b..dcc0d790 100644 --- a/common.mk +++ b/common.mk @@ -128,7 +128,7 @@ CFLAGS+=$(CFLAGS_USER) ifneq ($(MCL_SIZEOF_UNIT),) CFLAGS+=-DMCL_SIZEOF_UNIT=$(MCL_SIZEOF_UNIT) endif -MCL_USE_GMP?=1 +MCL_USE_GMP?=0 ifeq ($(MCL_USE_GMP),1) GMP_LIB=-lgmp -lgmpxx ifeq ($(UNAME_S),Darwin) diff --git a/test/static_init_test.cpp b/test/static_init_test.cpp index 9bfa6793..8430c069 100644 --- a/test/static_init_test.cpp +++ b/test/static_init_test.cpp @@ -1,3 +1,7 @@ +/* + If the binary compiled with DEBUG=1 and MCL_USE_GMP=1 calls init in a constructor of a static value, + then it will show GMP memory leaks, but this is a rare case. +*/ #define CYBOZU_TEST_DISABLE_AUTO_RUN #include #include