This is an automated email from the ASF dual-hosted git repository.

huajianlan pushed a commit to branch fe_local_shuffle
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 16d457c9e0bfec2aa10835ff4d5d5b9c078cedbc
Author: 924060929 <[email protected]>
AuthorDate: Thu Mar 26 11:43:25 2026 +0800

    [fix](build) add -dead_strip on macOS to fix dyld cache crash for large BE 
binary
    
    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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to