@@ -179,6 +179,11 @@ AC_ARG_ENABLE(module_surjectionproof,
179
179
[ enable_module_surjectionproof=$enableval] ,
180
180
[ enable_module_surjectionproof=no] )
181
181
182
+ AC_ARG_ENABLE ( asan ,
183
+ AS_HELP_STRING ( [ --enable-asan] ,[ enable ASAN (default is no)] ) ,
184
+ [ use_asani=$enableval] ,
185
+ [ use_asan=no] )
186
+
182
187
AC_ARG_WITH ( [ field] , [ AS_HELP_STRING ( [ --with-field=64bit|32bit|auto] ,
183
188
[ Specify Field Implementation. Default is auto] ) ] ,[ req_field=$withval] , [ req_field=auto] )
184
189
@@ -370,6 +375,10 @@ else
370
375
esac
371
376
fi
372
377
378
+ if test x"$enable_asan" = x"yes"; then
379
+ CFLAGS="$CFLAGS -fsanitize=address"
380
+ fi
381
+
373
382
# select assembly optimization
374
383
use_external_asm=no
375
384
@@ -549,6 +558,7 @@ AC_MSG_NOTICE([Building for coverage analysis: $enable_coverage])
549
558
AC_MSG_NOTICE ( [ Building ECDH module: $enable_module_ecdh] )
550
559
AC_MSG_NOTICE ( [ Building ECDSA pubkey recovery module: $enable_module_recovery] )
551
560
AC_MSG_NOTICE ( [ Using jni: $use_jni] )
561
+ AC_MSG_NOTICE ( [ Using ASAN: $use_asan] )
552
562
553
563
if test x"$enable_experimental" = x"yes"; then
554
564
AC_MSG_NOTICE ( [ ******] )
@@ -649,6 +659,7 @@ AM_CONDITIONAL([USE_JNI], [test x"$use_jni" == x"yes"])
649
659
AM_CONDITIONAL([ USE_EXTERNAL_ASM] , [ test x"$use_external_asm" = x"yes"] )
650
660
AM_CONDITIONAL([ USE_ASM_ARM] , [ test x"$set_asm" = x"arm"] )
651
661
AM_CONDITIONAL([ ENABLE_MODULE_SURJECTIONPROOF] , [ test x"$enable_module_surjectionproof" = x"yes"] )
662
+ AM_CONDITIONAL([ USE_ASAN] , [ test x"$use_asan" == x"yes"] )
652
663
653
664
dnl make sure nothing new is exported so that we don't break the cache
654
665
PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
0 commit comments