Skip to content

Commit c242e6b

Browse files
authored
Build mimalloc with MI_NO_OPT_ARCH (#7837)
This fixes the arm64 build so that it run on Raspberry Pi 4. See: microsoft/mimalloc#1095 Fixes: emscripten-core/emscripten#24930
1 parent 74ae98b commit c242e6b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

third_party/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ if(BUILD_MIMALLOC)
2525
set(MI_BUILD_OBJECT OFF)
2626
set(MI_BUILD_TESTS OFF)
2727
set(MI_INSTALL_TOPLEVEL ON)
28+
# Without this flag the resulting arm64 binary won't run on arm8-a devices
29+
# such as the Raspberry Pi 4.
30+
# This should probably be `MI_OPT_ARCH OFF` but that doesn't currently seem to
31+
# work. See: https://github.com/microsoft/mimalloc/issues/1095
32+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|armv[89].?|ARM64)$")
33+
set(MI_NO_OPT_ARCH ON)
34+
endif()
2835
# Do not show debug and warning messages of the allocator by default.
2936
# (They can still be enabled via MIMALLOC_VERBOSE=1 wasm-opt ...)
3037
add_compile_definitions(MI_DEBUG=0)

0 commit comments

Comments
 (0)