aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-09-06 19:57:31 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-09-07 12:25:25 +0300
commitbe630f9d6b2ebed570475c512dca7d986b95fc6d (patch)
tree83d231cb05cef50468799bee250dcb19e88442a0 /configure.ac
parent12771c10bf019e830107de038559c6cd3891abe6 (diff)
downloadlibmicrohttpd-be630f9d6b2ebed570475c512dca7d986b95fc6d.tar.gz
libmicrohttpd-be630f9d6b2ebed570475c512dca7d986b95fc6d.zip
configure: reset CFLAGS when testing for sanitizers
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index d6175ec2..92a6aaf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2638,7 +2638,7 @@ AS_VAR_IF([enable_sanitizers], ["yes"],
2638 AS_CASE(["$enabled_sanitizers"], [*undefined], 2638 AS_CASE(["$enabled_sanitizers"], [*undefined],
2639 [ 2639 [
2640 CFLAGS="${new_CFLAGS}" 2640 CFLAGS="${new_CFLAGS}"
2641 AX_APPEND_COMPILE_FLAGS([-fsanitize=bounds-strict -fsanitize=local-bounds -fsanitize=implicit-conversion -fsanitize=nullability-arg], 2641 AX_APPEND_LINK_FLAGS([-fsanitize=bounds-strict -fsanitize=local-bounds -fsanitize=implicit-conversion -fsanitize=nullability-arg],
2642 [new_CFLAGS], []) 2642 [new_CFLAGS], [])
2643 ] 2643 ]
2644 ) 2644 )
@@ -2655,17 +2655,18 @@ AS_VAR_IF([enable_sanitizers], ["yes"],
2655 enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+, }leak" 2655 enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+, }leak"
2656 ] 2656 ]
2657 ) 2657 )
2658
2659 AS_IF([test -z "${enabled_sanitizers}"], 2658 AS_IF([test -z "${enabled_sanitizers}"],
2660 [AC_MSG_ERROR([cannot find any sanitizer supported by $CC])]) 2659 [AC_MSG_ERROR([cannot find any sanitizer supported by $CC])])
2661 AS_VAR_IF([mhd_cv_cc_sanitizer_address],["yes"], 2660 AS_VAR_IF([mhd_cv_cc_sanitizer_address],["yes"],
2662 [ 2661 [
2663 new_CFLAGS="${new_CFLAGS} -D_FORTIFY_SOURCE=0" 2662 new_CFLAGS="${new_CFLAGS} -D_FORTIFY_SOURCE=0"
2663 CFLAGS="${new_CFLAGS}"
2664 AX_APPEND_COMPILE_FLAGS([-Wp,-U_FORTIFY_SOURCE], [new_CFLAGS]) 2664 AX_APPEND_COMPILE_FLAGS([-Wp,-U_FORTIFY_SOURCE], [new_CFLAGS])
2665 ], 2665 ],
2666 [AC_MSG_WARN([$CC does not support address sanitizer])] 2666 [AC_MSG_WARN([$CC does not support address sanitizer])]
2667 ) 2667 )
2668 # Always stop on error 2668 # Always stop on error
2669 CFLAGS="${new_CFLAGS}"
2669 AX_APPEND_COMPILE_FLAGS([-fno-sanitize-recover=all], [new_CFLAGS]) 2670 AX_APPEND_COMPILE_FLAGS([-fno-sanitize-recover=all], [new_CFLAGS])
2670 # Get better output for sanitizers error reporting 2671 # Get better output for sanitizers error reporting
2671 AX_APPEND_COMPILE_FLAGS([-fno-omit-frame-pointer -fno-common -fno-optimize-sibling-calls], 2672 AX_APPEND_COMPILE_FLAGS([-fno-omit-frame-pointer -fno-common -fno-optimize-sibling-calls],