Browse Source

Merge branch 'tor-github/pr/811' into maint-0.4.0

George Kadianakis 6 years ago
parent
commit
828f1829c8
2 changed files with 10 additions and 0 deletions
  1. 5 0
      changes/bug29527
  2. 5 0
      configure.ac

+ 5 - 0
changes/bug29527

@@ -0,0 +1,5 @@
+  o Minor features (circuit padding):
+    - Stop warning about undefined behavior in the probability distribution
+      tests. Float division by zero may technically be undefined behaviour in
+      C, but it's well-defined in IEEE 754. Partial backport of 29298.
+      Closes ticket 29527; bugfix on 0.4.0.1-alpha.

+ 5 - 0
configure.ac

@@ -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