@@ -3519,14 +3519,14 @@ AC_MSG_CHECKING([for --with-address-sanitizer])
35193519AC_ARG_WITH ( [ address_sanitizer] ,
35203520 AS_HELP_STRING ( [ --with-address-sanitizer] ,
35213521 [ enable AddressSanitizer memory error detector, 'asan' (default is no)] ) ,
3522- [
3523- AC_MSG_RESULT ( [ $withval] )
3522+ [ ] , [ with_address_sanitizer=no] )
3523+ AC_MSG_RESULT ( [ $with_address_sanitizer] )
3524+ AS_VAR_IF ( [ with_address_sanitizer] , [ no] , [ ] , [
35243525BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
35253526LDFLAGS="-fsanitize=address $LDFLAGS"
35263527# ASan works by controlling memory allocation, our own malloc interferes.
35273528with_pymalloc="no"
3528- ] ,
3529- [ AC_MSG_RESULT ( [ no] ) ] )
3529+ ] )
35303530
35313531AC_MSG_CHECKING ( [ for --with-memory-sanitizer] )
35323532AC_ARG_WITH (
@@ -3535,16 +3535,16 @@ AC_ARG_WITH(
35353535 [ --with-memory-sanitizer] ,
35363536 [ enable MemorySanitizer allocation error detector, 'msan' (default is no)]
35373537 ) ] ,
3538- [
3539- AC_MSG_RESULT ( [ $withval] )
3538+ [ ] , [ with_memory_sanitizer=no] )
3539+ AC_MSG_RESULT ( [ $with_memory_sanitizer] )
3540+ AS_VAR_IF ( [ with_memory_sanitizer] , [ no] , [ ] , [
35403541AX_CHECK_COMPILE_FLAG ( [ -fsanitize=memory] ,[
35413542BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
35423543LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
35433544] ,[ AC_MSG_ERROR ( [ The selected compiler doesn't support memory sanitizer] ) ] )
35443545# MSan works by controlling memory allocation, our own malloc interferes.
35453546with_pymalloc="no"
3546- ] ,
3547- [ AC_MSG_RESULT ( [ no] ) ] )
3547+ ] )
35483548
35493549AC_MSG_CHECKING ( [ for --with-undefined-behavior-sanitizer] )
35503550AC_ARG_WITH (
@@ -3553,15 +3553,14 @@ AC_ARG_WITH(
35533553 [ --with-undefined-behavior-sanitizer] ,
35543554 [ enable UndefinedBehaviorSanitizer undefined behaviour detector, 'ubsan' (default is no)]
35553555 ) ] ,
3556- [
3557- AC_MSG_RESULT ( [ $withval] )
3556+ [ ] , [ with_undefined_behavior_sanitizer=no] )
3557+ AC_MSG_RESULT ( [ $with_undefined_behavior_sanitizer] )
3558+ AS_VAR_IF ( [ with_undefined_behavior_sanitizer] , [ no] , [
3559+ with_ubsan="no"
3560+ ] , [
35583561BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
35593562LDFLAGS="-fsanitize=undefined $LDFLAGS"
35603563with_ubsan="yes"
3561- ] ,
3562- [
3563- AC_MSG_RESULT ( [ no] )
3564- with_ubsan="no"
35653564] )
35663565
35673566AC_MSG_CHECKING ( [ for --with-thread-sanitizer] )
@@ -3571,15 +3570,14 @@ AC_ARG_WITH(
35713570 [ --with-thread-sanitizer] ,
35723571 [ enable ThreadSanitizer data race detector, 'tsan' (default is no)]
35733572 ) ] ,
3574- [
3575- AC_MSG_RESULT ( [ $withval] )
3573+ [ ] , [ with_thread_sanitizer=no] )
3574+ AC_MSG_RESULT ( [ $with_thread_sanitizer] )
3575+ AS_VAR_IF ( [ with_thread_sanitizer] , [ no] , [
3576+ with_tsan="no"
3577+ ] , [
35763578BASECFLAGS="-fsanitize=thread $BASECFLAGS"
35773579LDFLAGS="-fsanitize=thread $LDFLAGS"
35783580with_tsan="yes"
3579- ] ,
3580- [
3581- AC_MSG_RESULT ( [ no] )
3582- with_tsan="no"
35833581] )
35843582
35853583# Set info about shared libraries.
0 commit comments