You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by hu...@apache.org on 2026/03/26 09:04:06 UTC
(doris) branch master updated: [fix](build) add -dead_strip on macOS to fix dyld cache crash for large BE binary (#61742)
This is an automated email from the ASF dual-hosted git repository.
huajianlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 07c9dd3386d [fix](build) add -dead_strip on macOS to fix dyld cache crash for large BE binary (#61742)
07c9dd3386d is described below
commit 07c9dd3386d59ab35ad93fa1bc9d6b05d59d9ce0
Author: 924060929 <la...@selectdb.com>
AuthorDate: Thu Mar 26 17:03:57 2026 +0800
[fix](build) add -dead_strip on macOS to fix dyld cache crash for large BE binary (#61742)
On macOS arm64, the doris_be binary (~2.2GB) has a virtual address space
of ~6.7GB (4GB __PAGEZERO + 2.7GB segments), which overlaps with the
dyld shared cache region. This causes "dyld cache not loaded: syscall to
map cache into shared region failed", making all system libraries
(libresolv, libiconv, CoreFoundation, etc.) fail to load and the BE
process crash on startup.
Adding -Wl,-dead_strip removes unreachable code and data, reducing the
binary to ~1.7GB and the virtual address space to ~6.1GB, which avoids
the dyld shared cache conflict.
---
be/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index e4d9f08eccf..0f85fcd7ba4 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -706,6 +706,11 @@ else()
-lresolv
-liconv
)
+ # On macOS arm64, large binaries (>2GB) can cause the virtual address space
+ # to overlap with the dyld shared cache region, resulting in "dyld cache not
+ # loaded: syscall to map cache into shared region failed". Use -dead_strip to
+ # remove unreachable code/data and reduce binary size.
+ add_link_options(-Wl,-dead_strip)
endif()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org