@@ -3496,14 +3496,14 @@ AC_MSG_CHECKING([for --with-address-sanitizer])
34963496AC_ARG_WITH ( [ address_sanitizer] ,
34973497 AS_HELP_STRING ( [ --with-address-sanitizer] ,
34983498 [ enable AddressSanitizer memory error detector, 'asan' (default is no)] ) ,
3499- [
3500- AC_MSG_RESULT ( [ $withval] )
3499+ [ ] , [ with_address_sanitizer=no] )
3500+ AC_MSG_RESULT ( [ $with_address_sanitizer] )
3501+ AS_VAR_IF ( [ with_address_sanitizer] , [ no] , [ ] , [
35013502BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
35023503LDFLAGS="-fsanitize=address $LDFLAGS"
35033504# ASan works by controlling memory allocation, our own malloc interferes.
35043505with_pymalloc="no"
3505- ] ,
3506- [ AC_MSG_RESULT ( [ no] ) ] )
3506+ ] )
35073507
35083508AC_MSG_CHECKING ( [ for --with-memory-sanitizer] )
35093509AC_ARG_WITH (
@@ -3512,16 +3512,16 @@ AC_ARG_WITH(
35123512 [ --with-memory-sanitizer] ,
35133513 [ enable MemorySanitizer allocation error detector, 'msan' (default is no)]
35143514 ) ] ,
3515- [
3516- AC_MSG_RESULT ( [ $withval] )
3515+ [ ] , [ with_memory_sanitizer=no] )
3516+ AC_MSG_RESULT ( [ $with_memory_sanitizer] )
3517+ AS_VAR_IF ( [ with_memory_sanitizer] , [ no] , [ ] , [
35173518AX_CHECK_COMPILE_FLAG ( [ -fsanitize=memory] ,[
35183519BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
35193520LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
35203521] ,[ AC_MSG_ERROR ( [ The selected compiler doesn't support memory sanitizer] ) ] )
35213522# MSan works by controlling memory allocation, our own malloc interferes.
35223523with_pymalloc="no"
3523- ] ,
3524- [ AC_MSG_RESULT ( [ no] ) ] )
3524+ ] )
35253525
35263526AC_MSG_CHECKING ( [ for --with-undefined-behavior-sanitizer] )
35273527AC_ARG_WITH (
@@ -3530,15 +3530,14 @@ AC_ARG_WITH(
35303530 [ --with-undefined-behavior-sanitizer] ,
35313531 [ enable UndefinedBehaviorSanitizer undefined behaviour detector, 'ubsan' (default is no)]
35323532 ) ] ,
3533- [
3534- AC_MSG_RESULT ( [ $withval] )
3533+ [ ] , [ with_undefined_behavior_sanitizer=no] )
3534+ AC_MSG_RESULT ( [ $with_undefined_behavior_sanitizer] )
3535+ AS_VAR_IF ( [ with_undefined_behavior_sanitizer] , [ no] , [
3536+ with_ubsan="no"
3537+ ] , [
35353538BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
35363539LDFLAGS="-fsanitize=undefined $LDFLAGS"
35373540with_ubsan="yes"
3538- ] ,
3539- [
3540- AC_MSG_RESULT ( [ no] )
3541- with_ubsan="no"
35423541] )
35433542
35443543AC_MSG_CHECKING ( [ for --with-thread-sanitizer] )
@@ -3548,15 +3547,14 @@ AC_ARG_WITH(
35483547 [ --with-thread-sanitizer] ,
35493548 [ enable ThreadSanitizer data race detector, 'tsan' (default is no)]
35503549 ) ] ,
3551- [
3552- AC_MSG_RESULT ( [ $withval] )
3550+ [ ] , [ with_thread_sanitizer=no] )
3551+ AC_MSG_RESULT ( [ $with_thread_sanitizer] )
3552+ AS_VAR_IF ( [ with_thread_sanitizer] , [ no] , [
3553+ with_tsan="no"
3554+ ] , [
35533555BASECFLAGS="-fsanitize=thread $BASECFLAGS"
35543556LDFLAGS="-fsanitize=thread $LDFLAGS"
35553557with_tsan="yes"
3556- ] ,
3557- [
3558- AC_MSG_RESULT ( [ no] )
3559- with_tsan="no"
35603558] )
35613559
35623560# Set info about shared libraries.
0 commit comments