From 203220116aeb29f935c8c86f458ee4e51cd1b077 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 29 Aug 2019 17:48:20 +0200 Subject: [PATCH] Temporarily disable getentropy()/getrandom() when using ASAN ASAN assumes a recent version of the C library has been installed and may end up intercepting functions that didn't exist if the actual C library is old. --- configure | 6 ++++++ configure.ac | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/configure b/configure index 8187a5f0..f7402df1 100755 --- a/configure +++ b/configure @@ -19017,6 +19017,9 @@ $as_echo_n "checking for getrandom with a standard API... " >&6; } #ifdef HAVE_SYS_RANDOM_H # include #endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif int main () @@ -19063,6 +19066,9 @@ $as_echo_n "checking for getentropy with a standard API... " >&6; } #ifdef HAVE_SYS_RANDOM_H # include #endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif int main () diff --git a/configure.ac b/configure.ac index a2de3fd4..8c050947 100644 --- a/configure.ac +++ b/configure.ac @@ -806,6 +806,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ #ifdef HAVE_SYS_RANDOM_H # include #endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif ]], [[ unsigned char buf; (void) getrandom((void *) &buf, 1U, 0U); @@ -824,6 +827,9 @@ unsigned char buf; #ifdef HAVE_SYS_RANDOM_H # include #endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif ]], [[ #ifdef __APPLE__ # error getentropy() is currently disabled on Apple operating systems