From 99e199f0eb0a2fa3bbc4841b9eb851f3ab632be9 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen <4643818-rmlarsen1@users.noreply.gitlab.com> Date: Tue, 4 Nov 2025 20:26:36 +0000 Subject: [PATCH] Make assume_aligned a no-op on ARM & ARM64 when msan is used, to work around a missing linker symbol. (cherry picked from commit 71703a98168405500ca03265cc1d000264e9024b) --- Eigen/src/Core/util/Memory.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index b1c244c9e..1492f72c9 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -1354,6 +1354,13 @@ EIGEN_DEVICE_FUNC void destroy_at(T* p) { } #endif +// FIXME(rmlarsen): Work around missing linker symbol with msan on ARM. +#if !defined(EIGEN_DONT_ASSUME_ALIGNED) && __has_feature(memory_sanitizer) && \ + (EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64) +#define EIGEN_DONT_ASSUME_ALIGNED +#endif + + #if !defined(EIGEN_DONT_ASSUME_ALIGNED) && defined(__cpp_lib_assume_aligned) && (__cpp_lib_assume_aligned >= 201811L) template EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) {