diff --git a/configure b/configure index a11cd0c27bcf0d0..1b81c6022bfbfdb 100755 --- a/configure +++ b/configure @@ -16191,6 +16191,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 640919bd07bd8db..fa076d486c29607 100644 --- a/configure.ac +++ b/configure.ac @@ -4466,6 +4466,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];