Skip to content

Commit 8496d4e

Browse files
cyb70289pitrou
andauthored
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]>
1 parent d271e50 commit 8496d4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2295,7 +2295,9 @@ if(ARROW_MIMALLOC)
22952295
-DMI_LOCAL_DYNAMIC_TLS=ON
22962296
-DMI_BUILD_OBJECT=OFF
22972297
-DMI_BUILD_SHARED=OFF
2298-
-DMI_BUILD_TESTS=OFF)
2298+
-DMI_BUILD_TESTS=OFF
2299+
# GH-47229: Force mimalloc to generate armv8.0 binary
2300+
-DMI_NO_OPT_ARCH=ON)
22992301

23002302
externalproject_add(mimalloc_ep
23012303
${EP_COMMON_OPTIONS}

0 commit comments

Comments
 (0)