Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to build with ASAN sanitizer #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ AC_ARG_ENABLE(module_surjectionproof,
[enable_module_surjectionproof=$enableval],
[enable_module_surjectionproof=no])

AC_ARG_ENABLE(asan,
AS_HELP_STRING([--enable-asan],[enable ASAN sanitizer (default is no)]),
[enable_asan=$enableval],
[enable_asan=no])

AC_ARG_WITH([field], [AS_HELP_STRING([--with-field=64bit|32bit|auto],
[Specify Field Implementation. Default is auto])],[req_field=$withval], [req_field=auto])

Expand Down Expand Up @@ -370,6 +375,10 @@ else
esac
fi

if test x"$enable_asan" = x"yes"; then
CFLAGS="$CFLAGS -fsanitize=address"
fi

# select assembly optimization
use_external_asm=no

Expand Down Expand Up @@ -549,6 +558,7 @@ AC_MSG_NOTICE([Building for coverage analysis: $enable_coverage])
AC_MSG_NOTICE([Building ECDH module: $enable_module_ecdh])
AC_MSG_NOTICE([Building ECDSA pubkey recovery module: $enable_module_recovery])
AC_MSG_NOTICE([Using jni: $use_jni])
AC_MSG_NOTICE([Using ASAN: $enable_asan])

if test x"$enable_experimental" = x"yes"; then
AC_MSG_NOTICE([******])
Expand Down Expand Up @@ -649,6 +659,7 @@ AM_CONDITIONAL([USE_JNI], [test x"$use_jni" == x"yes"])
AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$use_external_asm" = x"yes"])
AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm"])
AM_CONDITIONAL([ENABLE_MODULE_SURJECTIONPROOF], [test x"$enable_module_surjectionproof" = x"yes"])
AM_CONDITIONAL([USE_ASAN], [test x"$enable_asan" == x"yes"])

dnl make sure nothing new is exported so that we don't break the cache
PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
Expand Down