Skip to content

Commit

Permalink
[chore] Support aarch64 target with ldb_toolchain (#8249)
Browse files Browse the repository at this point in the history
  • Loading branch information
amosbird committed Feb 27, 2022
1 parent 351fbbc commit 7f3564c
Show file tree
Hide file tree
Showing 9 changed files with 492 additions and 949 deletions.
1 change: 0 additions & 1 deletion be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ if(ARCH_AARCH64)
${DORIS_DEPENDENCIES}
${WL_START_GROUP}
${COMMON_THIRDPARTY}
${WL_END_GROUP}
)
else()
set(DORIS_DEPENDENCIES
Expand Down
9 changes: 4 additions & 5 deletions be/src/glibc-compatibility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ if (GLIBC_COMPATIBILITY)
add_headers_and_sources(glibc_compatibility .)
add_headers_and_sources(glibc_compatibility musl)
if (ARCH_ARM)
# FastMemcpy not support arm, remove it from glibc_compatibility_sources
list (REMOVE_ITEM glibc_compatibility_sources FastMemcpy.c memcpy_wrapper.c)
list (APPEND glibc_compatibility_sources musl/aarch64/syscall.s musl/aarch64/longjmp.s)
set (musl_arch_include_dir musl/aarch64)
set (MEMCPY_SOURCE memcpy/memcpy_aarch64.cpp)
elseif (ARCH_AMD64)
list (APPEND glibc_compatibility_sources musl/x86_64/syscall.s musl/x86_64/longjmp.s)
set (musl_arch_include_dir musl/x86_64)
set (MEMCPY_SOURCE memcpy/memcpy_x86_64.cpp)
else ()
message (FATAL_ERROR "glibc_compatibility can only be used on x86_64 or aarch64.")
endif ()
Expand All @@ -48,18 +48,17 @@ if (GLIBC_COMPATIBILITY)
list(APPEND glibc_compatibility_sources musl/getentropy.c)
endif()

list(REMOVE_ITEM glibc_compatibility_sources musl/getrandom.c memcpy_wrapper.c)

# Need to omit frame pointers to match the performance of glibc
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer")

# NOTE(amos): getrandom is hard to interpose since we build thirdparty deps
# without glibc-compatibility. Also sanitizers might generate getrandom
# libcalls. Workaround: Use object file so that linker will always take a
# look at its symbol table.
list(REMOVE_ITEM glibc_compatibility_sources musl/getrandom.c)
# NOTE(amos): sanitizers might generate memcpy references that are too late to
# refer. Let's also extract memcpy definitions explicitly to avoid UNDEF GLIBC 2.14.
add_library(glibc-compatibility-explicit OBJECT musl/getrandom.c memcpy_wrapper.c)
add_library(glibc-compatibility-explicit OBJECT musl/getrandom.c ${MEMCPY_SOURCE})
target_compile_options(glibc-compatibility-explicit PRIVATE -fPIC)
add_library(glibc-compatibility STATIC ${glibc_compatibility_sources})

Expand Down
220 changes: 0 additions & 220 deletions be/src/glibc-compatibility/FastMemcpy.c

This file was deleted.

Loading

0 comments on commit 7f3564c

Please sign in to comment.