You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm getting test failures when trying to package 3.5.0 for Arch Linux, but only when building on an aarch64 host. All tests pass on an x86_64 host. This is not an issue with 3.4.5.
Test failure output is as follows:
Test project /build/mimalloc/src/build
Start 1: test-api
1/6 Test #1: test-api .........................***Exception: Illegal 0.08 sec
Start 2: test-api-fill
2/6 Test #2: test-api-fill ....................***Exception: Illegal 0.08 sec
Start 3: test-stress-heaps
3/6 Test #3: test-stress-heaps ................***Failed 0.09 sec
Illegal instruction
Start 4: test-stress-subprocs
4/6 Test #4: test-stress-subprocs .............***Exception: Illegal 0.07 sec
Start 5: test-stress
5/6 Test #5: test-stress ......................***Exception: Illegal 0.07 sec
Start 6: test-stress-dynamic
6/6 Test #6: test-stress-dynamic ..............***Failed 0.09 sec
Illegal instruction
0% tests passed, 6 tests failed out of 6
Total Test time (real) = 0.48 sec
The following tests FAILED:
1 - test-api (ILLEGAL)
2 - test-api-fill (ILLEGAL)
3 - test-stress-heaps (Failed)
4 - test-stress-subprocs (ILLEGAL)
5 - test-stress (ILLEGAL)
6 - test-stress-dynamic (Failed)
Errors while running CTest
Please let me know if there is any other information I can provide. Thank you!
Ah, can you try with cmake -DMI_OPT_ARCH=OFF ? I recently changed from armv8.1 to armv8.3 since the latter has a load-acquire instruction which speeds things up. Maybe you run on an arm processor that doesn't support that?
That didn't work but setting -D MI_NO_OPT_ARCH=ON did which I figured out from this comment. I am building on a cloud host (neoverse-n1) which I believe is v8.2, but I am targeting aarch64 in general which means v8. Arch generally does this by setting march=armv8-a in CFLAGS. Is there a recommended approach for that case?
Ah, I will fix the MI_OPT_ARCH issue so MI_NO_OPT_ARCH is not needed. Mimalloc used to use just armv8.1-a for MI_OPT_ARCH but recently I changed it to armv8.3-a (which has the LDAPR instruction). I think I will revert this again (or perhaps only use as default on Apple) as maybe there are just too many armv8.1-a processors out there. Less than armv8.1-a is not great though as those lack fast atomic operations. tbc.
Thank you for considering this case! Arch doesn't have any packages that explicitly depend on this project, but it is very well maintained for x86_64. A few of us have been working on a Port of Arch packages to aarch64, though it's an open question right now whether we will target v8 or v8.2 (or both) long-term. It is safe to assume the build hosts themselves will be v8.2 (or later) hosts, but the target march we may compile to could be as low as v8.
Basically if you support v8 then you are Raspberry Pi 4 and later era. The Pi 5 is v8.2. You point out the obvious downside: those early v8 devices lack CPU instructions that often introduce a performance penalty to workaround.
Thanks :-) In the latest v3.5.1 the default -DMI_OPT_ARCH is set to armv8.1 for a Linux build (and armv8.3 only for Apple builds). The armv8.1-a is much better for mimalloc as it contains native atomic operations that mimalloc uses a lot. The armv8.3 further adds an efficient load-acquire which also benefits mimalloc (but to a lesser extent).
You may consider having a normal build for arm8.1-a and another for older devices with MI_OPT_ARCH=OFF.
Activity
daanx commentedon Aug 29, 2026
Ah, can you try with cmake
-DMI_OPT_ARCH=OFF? I recently changed from armv8.1 to armv8.3 since the latter has a load-acquire instruction which speeds things up. Maybe you run on an arm processor that doesn't support that?bschnei commentedon Aug 29, 2026
That didn't work but setting
-D MI_NO_OPT_ARCH=ONdid which I figured out from this comment. I am building on a cloud host (neoverse-n1) which I believe is v8.2, but I am targeting aarch64 in general which means v8. Arch generally does this by settingmarch=armv8-ainCFLAGS. Is there a recommended approach for that case?daanx commentedon Aug 30, 2026
Ah, I will fix the
MI_OPT_ARCHissue soMI_NO_OPT_ARCHis not needed. Mimalloc used to use justarmv8.1-aforMI_OPT_ARCHbut recently I changed it toarmv8.3-a(which has theLDAPRinstruction). I think I will revert this again (or perhaps only use as default on Apple) as maybe there are just too manyarmv8.1-aprocessors out there. Less thanarmv8.1-ais not great though as those lack fast atomic operations. tbc.ensure MI_OPT_ARCH=OFF is respected on arm64 (issue #1382)
Allow specicic architecture to be passed to MI_OPT_ARCH; default to a…
bschnei commentedon Sep 1, 2026
Thank you for considering this case! Arch doesn't have any packages that explicitly depend on this project, but it is very well maintained for
x86_64. A few of us have been working on a Port of Arch packages toaarch64, though it's an open question right now whether we will target v8 or v8.2 (or both) long-term. It is safe to assume the build hosts themselves will be v8.2 (or later) hosts, but the targetmarchwe may compile to could be as low as v8.Basically if you support v8 then you are Raspberry Pi 4 and later era. The Pi 5 is v8.2. You point out the obvious downside: those early v8 devices lack CPU instructions that often introduce a performance penalty to workaround.
daanx commentedon Sep 1, 2026
Thanks :-) In the latest v3.5.1 the default
-DMI_OPT_ARCHis set to armv8.1 for a Linux build (and armv8.3 only for Apple builds). The armv8.1-a is much better for mimalloc as it contains native atomic operations that mimalloc uses a lot. The armv8.3 further adds an efficient load-acquire which also benefits mimalloc (but to a lesser extent).You may consider having a normal build for arm8.1-a and another for older devices with MI_OPT_ARCH=OFF.
bschnei commentedon Sep 2, 2026
3.5.1 builds and all tests pass just fine with
march=armv8-a. Thank you!Allow specicic architecture to be passed to MI_OPT_ARCH; default to a…