diff --git a/configure b/configure index 2a4b6fc96cc863a..1a00f44916b51a6 100755 --- a/configure +++ b/configure @@ -15064,6 +15064,11 @@ else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef __has_attribute +# if __has_attribute(no_sanitize) +__attribute__((no_sanitize("alignment"))) +# endif +#endif int main(void) { char s[16]; diff --git a/configure.ac b/configure.ac index f51935d8813ca64..f7661778b757421 100644 --- a/configure.ac +++ b/configure.ac @@ -4015,6 +4015,11 @@ esac # check for systems that require aligned memory access AC_CACHE_CHECK([aligned memory access is required], [ac_cv_aligned_required], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#ifdef __has_attribute +# if __has_attribute(no_sanitize) +__attribute__((no_sanitize("alignment"))) +# endif +#endif int main(void) { char s[16];