]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Silence unneeded clang warns that triggered in prob distr tests.
authorGeorge Kadianakis <desnacked@riseup.net>
Mon, 25 Feb 2019 13:29:41 +0000 (15:29 +0200)
committerteor <teor@torproject.org>
Wed, 20 Mar 2019 08:02:54 +0000 (18:02 +1000)
See https://trac.torproject.org/projects/tor/ticket/29528#comment:3
and https://bugs.llvm.org/show_bug.cgi?id=19535

configure.ac

index 91a04984408f9173b628123a056d91d8f7944f7c..0f7eb61f256b8eb7abd0d8cdb40a6aff9228fcca 100644 (file)
@@ -1198,6 +1198,11 @@ if test "$fragile_hardening" = "yes"; then
       AC_MSG_ERROR([The compiler supports -fsanitize=undefined, but for some reason I was not able to link when using it. Are you missing run-time support? With GCC you need libasan.*, and with Clang you need libclang_rt.ubsan*])
     fi
 
+   TOR_TRY_COMPILE_WITH_CFLAGS([-fno-sanitize=float-divide-by-zero], also_link, CFLAGS_UBSAN="-fno-sanitize=float-divide-by-zero", true)
+    if test "$tor_cv_cflags__fno_sanitize_float_divide_by_zero" = "yes" && test "$tor_can_link__fno_sanitize_float_divide_by_zero" != "yes"; then
+      AC_MSG_ERROR([The compiler supports -fno-sanitize=float-divide-by-zero, but for some reason I was not able to link when using it. Are you missing run-time support? With GCC you need libasan.*, and with Clang you need libclang_rt.ubsan*])
+    fi
+
 TOR_CHECK_CFLAGS([-fno-omit-frame-pointer])
 fi