[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: Added more options for undefined behavior sanitiz
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: Added more options for undefined behavior sanitizer |
Date: |
Sun, 05 Sep 2021 13:46:25 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 169cd95f9e2a1a25c0ce7d4cdd7a19030fb63eab
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Sep 5 13:59:49 2021 +0300
Added more options for undefined behavior sanitizer
* Added ability to use sanitizer on systems without run-time UBSan library
---
configure.ac | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/configure.ac b/configure.ac
index e832afd6..2a8e4e39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2596,6 +2596,49 @@ AS_VAR_IF([enable_sanitizers], ["yes"],
[
new_CFLAGS="${new_CFLAGS} -fsanitize=undefined"
enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+,
}undefined"
+ ],
+ [
+ AC_CACHE_CHECK([for undefined behavior sanitizer with
'-fsanitize-undefined-trap-on-error'], [mhd_cv_cc_sanitizer_undefined_trap],
+ [
+ CFLAGS="${new_CFLAGS} -fsanitize=undefined
-fsanitize-undefined-trap-on-error"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [mhd_cv_cc_sanitizer_undefined_trap=yes],
[mhd_cv_cc_sanitizer_undefined_trap=no])
+ ]
+ )
+ AS_VAR_IF([mhd_cv_cc_sanitizer_undefined_trap], ["yes"],
+ [
+ new_CFLAGS="${new_CFLAGS} -fsanitize=undefined
-fsanitize-undefined-trap-on-error"
+
enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+, }undefined"
+ AC_MSG_WARN([Enabled sanitizer without run-time library, error
reporting will be limited])
+ ],
+ [
+ AS_IF([test -z "${enabled_sanitizers}"],
+ [
+ # Last resort
+ AC_CACHE_CHECK([for undefined behavior sanitizer with
'-fsanitize-trap=all'], [mhd_cv_cc_sanitizer_undefined_trap_all],
+ [
+ CFLAGS="${new_CFLAGS} -fsanitize=undefined
-fsanitize-undefined-trap-on-error"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [mhd_cv_cc_sanitizer_undefined_trap_all=yes],
[mhd_cv_cc_sanitizer_undefined_trap_all=no])
+ ]
+ )
+ AS_VAR_IF([mhd_cv_cc_sanitizer_undefined_trap_all],["yes"],
+ [
+ new_CFLAGS="${new_CFLAGS} -fsanitize=undefined
-fsanitize-undefined-trap-on-error"
+
enabled_sanitizers="${enabled_sanitizers}${enabled_sanitizers:+, }undefined"
+ AC_MSG_WARN([Enabled sanitizer without run-time
library, error reporting will be limited])
+ ]
+ )
+ ]
+ )
+ ]
+ )
+ ]
+ )
+ AS_CASE(["$enabled_sanitizers"], [*undefined],
+ [
+ AX_APPEND_COMPILE_FLAGS([-fsanitize=bounds-strict
-fsanitize=local-bounds -fsanitize=implicit-conversion
-fsanitize=nullability-arg],
+ [new_CFLAGS], [${new_CFLAGS}])
]
)
AC_CACHE_CHECK([for leak sanitizer], [mhd_cv_cc_sanitizer_leak],
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.