This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8496d4e077 GH-47229: [C++][Arm] Force mimalloc to generate armv8.0 
binary (#47766)
8496d4e077 is described below

commit 8496d4e077f8660f7b124010935836c84707cb40
Author: Yibo Cai <[email protected]>
AuthorDate: Thu Oct 9 16:00:19 2025 +0800

    GH-47229: [C++][Arm] Force mimalloc to generate armv8.0 binary (#47766)
    
    ### Rationale for this change
    Mimalloc default generates LSE atomic instructions only work on armv8.1. 
This causes illegal instruction on armv8.0 platforms like Raspberry4. This PR 
sets mimalloc build flag -DMI_NO_OPT_ARCH=ON to disable LSE instruction.
    Please note even with flag set, compiler and libc will replace the atmoic 
call with an ifunc that matches hardware best at runtime. That means LSE is 
used only if the running platform supports it.
    
    ### What changes are included in this PR?
    Force mimalloc build flag -DMI_NO_OPT_ARCH=ON.
    
    ### Are these changes tested?
    Manually tested.
    
    ### Are there any user-facing changes?
    No.
    
    **This PR contains a "Critical Fix".**
    Fixes crashes on Armv8.0 platform.
    * GitHub Issue: #47229
    
    Lead-authored-by: Yibo Cai <[email protected]>
    Co-authored-by: Antoine Pitrou <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 4e63b9d907..7d110e8dbb 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -2295,7 +2295,9 @@ if(ARROW_MIMALLOC)
       -DMI_LOCAL_DYNAMIC_TLS=ON
       -DMI_BUILD_OBJECT=OFF
       -DMI_BUILD_SHARED=OFF
-      -DMI_BUILD_TESTS=OFF)
+      -DMI_BUILD_TESTS=OFF
+      # GH-47229: Force mimalloc to generate armv8.0 binary
+      -DMI_NO_OPT_ARCH=ON)
 
   externalproject_add(mimalloc_ep
                       ${EP_COMMON_OPTIONS}

Reply via email to