Skip to content

GH-47229: [C++][Arm] Force mimalloc to generate armv8.0 binary - #47766

Merged
pitrou merged 2 commits into
apache:mainfrom
cyb70289:47229
Oct 9, 2025
Merged

GH-47229: [C++][Arm] Force mimalloc to generate armv8.0 binary#47766
pitrou merged 2 commits into
apache:mainfrom
cyb70289:47229

Conversation

@cyb70289

@cyb70289cyb70289 commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

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-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47229has been automatically assigned in GitHub to PR creator.

@pitrou

Copy link
Copy Markdown
Member

Can you check if this patch is still necessary if we apply #47589 ?

Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake Outdated
@github-actionsgithub-actionsBot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 9, 2025
@cyb70289

Copy link
Copy Markdown
ContributorAuthor

Can you check if this patch is still necessary if we apply #47589 ?

Looks necessary for mimalloc 3.1.5. The default setting is still armv8.1-a unless this option is set.
https://github.com/microsoft/mimalloc/blob/v3.1.5/CMakeLists.txt#L153

…ble 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.
Comment threadcpp/cmake_modules/ThirdpartyToolchain.cmake
@pitrou

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp

@pitrou

Copy link
Copy Markdown
Member

@github-actions crossbow submit wheelcp313*

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
@github-actions

Copy link
Copy Markdown

Revision: ff8e8c3

Submitted crossbow builds: ursacomputing/crossbow @ actions-7e9ea384fd

TaskStatus
wheel-macos-monterey-cp313-cp313-amd64GitHub Actions
wheel-macos-monterey-cp313-cp313-arm64GitHub Actions
wheel-macos-monterey-cp313-cp313t-amd64GitHub Actions
wheel-macos-monterey-cp313-cp313t-arm64GitHub Actions
wheel-manylinux-2-28-cp313-cp313-amd64GitHub Actions
wheel-manylinux-2-28-cp313-cp313-arm64GitHub Actions
wheel-manylinux-2-28-cp313-cp313t-amd64GitHub Actions
wheel-manylinux-2-28-cp313-cp313t-arm64GitHub Actions
wheel-musllinux-1-2-cp313-cp313-amd64GitHub Actions
wheel-musllinux-1-2-cp313-cp313-arm64GitHub Actions
wheel-musllinux-1-2-cp313-cp313t-amd64GitHub Actions
wheel-musllinux-1-2-cp313-cp313t-arm64GitHub Actions
wheel-windows-cp313-cp313-amd64GitHub Actions
wheel-windows-cp313-cp313t-amd64GitHub Actions

@github-actions

Copy link
Copy Markdown

Revision: ff8e8c3

Submitted crossbow builds: ursacomputing/crossbow @ actions-a989831826

TaskStatus
example-cpp-minimal-build-staticGitHub Actions
example-cpp-minimal-build-static-system-dependencyGitHub Actions
example-cpp-tutorialGitHub Actions
test-build-cpp-fuzzGitHub Actions
test-conda-cppGitHub Actions
test-conda-cpp-valgrindGitHub Actions
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1GitHub Actions
test-debian-12-cpp-amd64GitHub Actions
test-debian-12-cpp-i386GitHub Actions
test-fedora-42-cppGitHub Actions
test-ubuntu-22.04-cppGitHub Actions
test-ubuntu-22.04-cpp-20GitHub Actions
test-ubuntu-22.04-cpp-bundledGitHub Actions
test-ubuntu-22.04-cpp-emscriptenGitHub Actions
test-ubuntu-22.04-cpp-no-threadingGitHub Actions
test-ubuntu-24.04-cppGitHub Actions
test-ubuntu-24.04-cpp-bundled-offlineGitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundledGitHub Actions
test-ubuntu-24.04-cpp-gcc-14GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formatsGitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizerGitHub Actions

@pitroupitrou added the CI: Extra: C++ Run extra C++ CI label Oct 9, 2025
kou
kou approved these changes Oct 9, 2025

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@github-actionsgithub-actionsBot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Oct 9, 2025
@pitrou
pitrou merged commit 8496d4e into apache:mainOct 9, 2025
48 checks passed
@pitroupitrou removed the awaiting merge Awaiting merge label Oct 9, 2025
raulcd pushed a commit that referenced this pull request Oct 9, 2025
### 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 <cyb70289@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 8496d4e.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Oct 15, 2025
…pache#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: apache#47229
Lead-authored-by: Yibo Cai <cyb70289@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Mottl pushed a commit to Mottl/arrow that referenced this pull request May 26, 2026
…pache#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: apache#47229
Lead-authored-by: Yibo Cai <cyb70289@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@cyb70289@pitrou@kou