From f05176ef7ff012ca10fa2f71c3718d85d721a004 Mon Sep 17 00:00:00 2001 From: "Alexander F. Lent" Date: Thu, 19 Feb 2026 03:38:40 -0500 Subject: [PATCH] Fix build on aarch64 by changing USE_MIMALLOC default Signed-off-by: Alexander F. Lent --- python-torch.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python-torch.spec b/python-torch.spec index c1f4892..67fe444 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -443,6 +443,15 @@ sed -i -e 's@ checkout_nccl()@ True@' tools/build_pytorch_libs.py # Disable the use of check_submodule's in the setup.py, we are a tarball, not a git repo sed -i -e 's@check_submodules()$@#check_submodules()@' setup.py +# Disable the USE_MIMALLOC option, which is now default on AArch64 +# The comments in setup.py say that the env var is respected. +# This seems to be wrong on AArch64, where the default is overriden to ON. +# TODO: File an upstream bug about this misbehavior. +# TODO: Consider unbundling mimalloc since upstream says it's faster. +%ifarch aarch64 +sed -i -e 's@set(USE_MIMALLOC ON)@set(USE_MIMALLOC OFF)@' CMakeLists.txt +%endif + # Release comes fully loaded with third party src # Remove what we can #