File tree Expand file tree Collapse file tree
be/src/glibc-compatibility Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,16 @@ if (GLIBC_COMPATIBILITY)
5959 list (REMOVE_ITEM glibc_compatibility_sources musl/getrandom.c)
6060 # NOTE(amos): sanitizers might generate memcpy references that are too late to
6161 # refer. Let's also extract memcpy definitions explicitly to avoid UNDEF GLIBC 2.14.
62- add_library (glibc-compatibility-explicit OBJECT musl/getrandom.c ${MEMCPY_SOURCE} )
62+ #
63+ # NOTE: On ARM (aarch64) with ASAN, the custom memcpy (memcpy_aarch64.cpp) overrides
64+ # the global memcpy symbol. libpthread's __pthread_initialize_minimal() calls memcpy
65+ # before ASAN shadow memory is initialized, causing SIGSEGV. Skip custom memcpy in
66+ # this case and fall back to glibc's memcpy.
67+ if (ARCH_ARM AND (CMAKE_BUILD_TYPE STREQUAL "ASAN_UT" OR CMAKE_BUILD_TYPE STREQUAL "ASAN" ))
68+ add_library (glibc-compatibility-explicit OBJECT musl/getrandom.c )
69+ else ()
70+ add_library (glibc-compatibility-explicit OBJECT musl/getrandom.c ${MEMCPY_SOURCE} )
71+ endif ()
6372 target_compile_options (glibc-compatibility-explicit PRIVATE -fPIC )
6473 add_library (glibc-compatibility STATIC ${glibc_compatibility_sources} )
6574 target_compile_options (
You can’t perform that action at this time.
0 commit comments