Skip to content

Commit

Permalink
Fix open source aarch64 cmake build
Browse files Browse the repository at this point in the history
Summary:
The cmake build needs to be aware of the aarch64 external assembler
sources to avoid referencing unknown symbols at link time.

Fixes #2251

Reviewed By: dmm-fb

Differential Revision: D59635179

fbshipit-source-id: 64ca5c50c8fc78d7f1289c0d23edc696d3b61a37
  • Loading branch information
Michael van der Westhuizen authored and facebook-github-bot committed Jul 11, 2024
1 parent 5f0d152 commit c30d49d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ else()
set(IS_X86_64_ARCH FALSE)
endif()

if(NOT DEFINED IS_AARCH64_ARCH AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
set(IS_AARCH64_ARCH TRUE)
else()
set(IS_AARCH64_ARCH FALSE)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Check target architecture
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down Expand Up @@ -372,6 +378,25 @@ if (IS_X86_64_ARCH AND NOT MSVC)
)
endif()

set(ARM_AOR_ASM_FILES
${FOLLY_DIR}/external/aor/memcpy-advsimd.S
${FOLLY_DIR}/external/aor/memcpy-armv8.S
${FOLLY_DIR}/external/aor/memcpy_sve.S
${FOLLY_DIR}/external/aor/memset-advsimd.S
)
if (IS_AARCH64_ARCH)
foreach (AOR_FILE IN LISTS ARM_AOR_ASM_FILES)
set_property(
SOURCE
${AOR_FILE}
APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp"
)
list(APPEND folly_base_files
${AOR_FILE}
)
endforeach()
endif()

add_library(folly_base OBJECT
${folly_base_files}
${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
Expand Down

0 comments on commit c30d49d

Please sign in to comment.