diff options
author | Yann Ylavic <ylavic@apache.org> | 2016-10-06 21:11:43 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2016-10-06 21:11:43 +0000 |
commit | 3b0af81d1ee8dc1ca4dfc2f3c7aa6f50515a2c8f (patch) | |
tree | 5940ecbcafec6bc5cbf5b247a1c5ea4359b43fdf /configure.in | |
parent | 496dd085dfd4798ca178d0d6120c281960be3950 (diff) | |
download | apr-3b0af81d1ee8dc1ca4dfc2f3c7aa6f50515a2c8f.tar.gz |
crypto: provide apr_crypto_memzero, garanteed to not be optimized out by
compilers.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763665 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/configure.in b/configure.in index b7d2750f5..2664b4e13 100644 --- a/configure.in +++ b/configure.in @@ -507,6 +507,22 @@ if test "$ap_cv_atomic_builtins" = "yes"; then AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins]) fi +AC_CACHE_CHECK([whether the compiler handles weak symbols], [ap_cv_weak_symbols], +[AC_TRY_RUN([ +__attribute__ ((weak)) +int weak_noop(void) +{ + return 0; +} +int main() +{ + return weak_noop(); +}], [ap_cv_weak_symbols=yes], [ap_cv_weak_symbols=no], [ap_cv_weak_symbols=no])]) + +if test "$ap_cv_weak_symbols" = "yes"; then + AC_DEFINE(HAVE_WEAK_SYMBOLS, 1, [Define if compiler handles weak symbols]) +fi + case $host in powerpc-405-*) # The IBM ppc405cr processor has a bugged stwcx instruction. @@ -1938,6 +1954,43 @@ AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) +AC_CACHE_CHECK([for memset_s support], [apr_cv_memset_s], +[AC_TRY_RUN([ +#ifdef HAVE_STRING_H +#define __STDC_WANT_LIB_EXT1__ 1 +#include <string.h> +#endif + +int main(int argc, const char **argv) +{ + char buf[1] = "1"; + return memset_s(buf, sizeof buf, 0, sizeof buf) != 0 || *buf != '\0'; +}], [apr_cv_memset_s=yes], [apr_cv_memset_s=no], [apr_cv_memset_s=no])]) + +if test "$apr_cv_memset_s" = "yes"; then + AC_DEFINE([HAVE_MEMSET_S], 1, [Define if memset_s function is supported]) +fi + +AC_CACHE_CHECK([for explicit_bzero support], [apr_cv_explicit_bzero], +[AC_TRY_RUN([ +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif + +int main(int argc, const char **argv) +{ + char buf[1] = "1"; + explicit_bzero(buf, sizeof buf); + return *buf != '\0'; +}], [apr_cv_explicit_bzero=yes], [apr_cv_explicit_bzero=no], [apr_cv_explicit_bzero=no])]) + +if test "$apr_cv_explicit_bzero" = "yes"; then + AC_DEFINE([HAVE_EXPLICIT_BZERO], 1, [Define if explicit_bzero function is supported]) +fi + if test "$off_t_strfn" = "apr_strtoi64" && test "$have_int64_strfn" = "1"; then off_t_strfn=$int64_strfn fi |