@@ -3401,14 +3401,14 @@ AC_MSG_CHECKING([for --with-address-sanitizer])
34013401AC_ARG_WITH ( [ address_sanitizer] ,
34023402 AS_HELP_STRING ( [ --with-address-sanitizer] ,
34033403 [ enable AddressSanitizer memory error detector, 'asan' (default is no)] ) ,
3404- [
3405- AC_MSG_RESULT ( [ $withval] )
3404+ [ ] , [ with_address_sanitizer=no] )
3405+ AC_MSG_RESULT ( [ $with_address_sanitizer] )
3406+ AS_VAR_IF ( [ with_address_sanitizer] , [ no] , [ ] , [
34063407BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
34073408LDFLAGS="-fsanitize=address $LDFLAGS"
34083409# ASan works by controlling memory allocation, our own malloc interferes.
34093410with_pymalloc="no"
3410- ] ,
3411- [ AC_MSG_RESULT ( [ no] ) ] )
3411+ ] )
34123412
34133413AC_MSG_CHECKING ( [ for --with-memory-sanitizer] )
34143414AC_ARG_WITH (
@@ -3417,16 +3417,16 @@ AC_ARG_WITH(
34173417 [ --with-memory-sanitizer] ,
34183418 [ enable MemorySanitizer allocation error detector, 'msan' (default is no)]
34193419 ) ] ,
3420- [
3421- AC_MSG_RESULT ( [ $withval] )
3420+ [ ] , [ with_memory_sanitizer=no] )
3421+ AC_MSG_RESULT ( [ $with_memory_sanitizer] )
3422+ AS_VAR_IF ( [ with_memory_sanitizer] , [ no] , [ ] , [
34223423AX_CHECK_COMPILE_FLAG ( [ -fsanitize=memory] ,[
34233424BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
34243425LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
34253426] ,[ AC_MSG_ERROR ( [ The selected compiler doesn't support memory sanitizer] ) ] )
34263427# MSan works by controlling memory allocation, our own malloc interferes.
34273428with_pymalloc="no"
3428- ] ,
3429- [ AC_MSG_RESULT ( [ no] ) ] )
3429+ ] )
34303430
34313431AC_MSG_CHECKING ( [ for --with-undefined-behavior-sanitizer] )
34323432AC_ARG_WITH (
@@ -3435,15 +3435,14 @@ AC_ARG_WITH(
34353435 [ --with-undefined-behavior-sanitizer] ,
34363436 [ enable UndefinedBehaviorSanitizer undefined behaviour detector, 'ubsan' (default is no)]
34373437 ) ] ,
3438- [
3439- AC_MSG_RESULT ( [ $withval] )
3438+ [ ] , [ with_undefined_behavior_sanitizer=no] )
3439+ AC_MSG_RESULT ( [ $with_undefined_behavior_sanitizer] )
3440+ AS_VAR_IF ( [ with_undefined_behavior_sanitizer] , [ no] , [
3441+ with_ubsan="no"
3442+ ] , [
34403443BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
34413444LDFLAGS="-fsanitize=undefined $LDFLAGS"
34423445with_ubsan="yes"
3443- ] ,
3444- [
3445- AC_MSG_RESULT ( [ no] )
3446- with_ubsan="no"
34473446] )
34483447
34493448AC_MSG_CHECKING ( [ for --with-thread-sanitizer] )
@@ -3453,15 +3452,14 @@ AC_ARG_WITH(
34533452 [ --with-thread-sanitizer] ,
34543453 [ enable ThreadSanitizer data race detector, 'tsan' (default is no)]
34553454 ) ] ,
3456- [
3457- AC_MSG_RESULT ( [ $withval] )
3455+ [ ] , [ with_thread_sanitizer=no] )
3456+ AC_MSG_RESULT ( [ $with_thread_sanitizer] )
3457+ AS_VAR_IF ( [ with_thread_sanitizer] , [ no] , [
3458+ with_tsan="no"
3459+ ] , [
34583460BASECFLAGS="-fsanitize=thread $BASECFLAGS"
34593461LDFLAGS="-fsanitize=thread $LDFLAGS"
34603462with_tsan="yes"
3461- ] ,
3462- [
3463- AC_MSG_RESULT ( [ no] )
3464- with_tsan="no"
34653463] )
34663464
34673465# Set info about shared libraries.
0 commit comments