From ae17df132a1ae640f846ffc4d9b000cdf58bc51b Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 31 Oct 2026 17:13:26 +0000 Subject: [PATCH] Disable UBSan alignment check in `configure`'s aligned-access test (GH-161012) (cherry picked from commit 90dc8bdc09b7b20c4206fec7f119d5bac5d48c52) Co-authored-by: Stan Ulbrych --- configure | 5 +++++ configure.ac | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/configure b/configure index 6f7ff1b04a37d98..0c195027c4a309c 100755 --- a/configure +++ b/configure @@ -15570,6 +15570,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 99238054b9a6c3a..b9e175abd899217 100644 --- a/configure.ac +++ b/configure.ac @@ -4129,6 +4129,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];