Skip to content

Commit ff8e8c3

Browse files
committed
GH-47229: [C++][Arm] Force mimalloc to generate armv8.0 compatible binary
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.
1 parent fcf3b4b commit ff8e8c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,8 @@ if(ARROW_MIMALLOC)
22942294
-DMI_LOCAL_DYNAMIC_TLS=ON
22952295
-DMI_BUILD_OBJECT=OFF
22962296
-DMI_BUILD_SHARED=OFF
2297-
-DMI_BUILD_TESTS=OFF)
2297+
-DMI_BUILD_TESTS=OFF
2298+
-DMI_NO_OPT_ARCH=ON)
22982299

22992300
externalproject_add(mimalloc_ep
23002301
${EP_COMMON_OPTIONS}

0 commit comments

Comments
 (0)