Unverified Commit 0156b33d authored by Emily's avatar Emily Committed by GitHub
Browse files

folly: fix aarch64-linux build (#490873)

parents b75e1443 e56fb7fd
Loading
Loading
Loading
Loading
+57 −0
Original line number Diff line number Diff line
From 9acd1ec8e6890c7f5d86a0dd6941ae3b8692ac9c Mon Sep 17 00:00:00 2001
From: Lukas Krenz <lkrenz@nvidia.com>
Date: Tue, 20 Jan 2026 05:59:00 -0800
Subject: [PATCH] Fix memset/memcpy linkage on aarch64

Otherwise memcpy and memset benchmarks won't compile
---
 folly/CMakeLists.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt
index a1bcbdd6e92..51280821a24 100644
--- a/folly/CMakeLists.txt
+++ b/folly/CMakeLists.txt
@@ -879,6 +879,9 @@ folly_add_library(
   NAME memset-impl
   SRCS
     FollyMemset.cpp
+    $<$<BOOL:${IS_AARCH64_ARCH}>:memset_select_aarch64.cpp>
+  DEPS
+    $<$<BOOL:${IS_AARCH64_ARCH}>:folly_external_aor_memset_aarch64>
 )
 
 folly_add_library(
@@ -894,12 +897,20 @@ folly_add_library(
   EXCLUDE_FROM_MONOLITH
   SRCS
     FollyMemset.cpp
+    $<$<BOOL:${IS_AARCH64_ARCH}>:memset_select_aarch64.cpp>
+  DEPS
+    $<$<BOOL:${IS_AARCH64_ARCH}>:folly_external_aor_memset_aarch64-use>
+  COMPILE_OPTIONS
+    $<$<BOOL:${IS_AARCH64_ARCH}>:-DFOLLY_MEMSET_IS_MEMSET>
 )
 
 folly_add_library(
   NAME memcpy-impl
   SRCS
     FollyMemcpy.cpp
+    $<$<BOOL:${IS_AARCH64_ARCH}>:memcpy_select_aarch64.cpp>
+  DEPS
+    $<$<BOOL:${IS_AARCH64_ARCH}>:folly_external_aor_memcpy_aarch64>
 )
 
 folly_add_library(
@@ -915,6 +926,11 @@ folly_add_library(
   EXCLUDE_FROM_MONOLITH
   SRCS
     FollyMemcpy.cpp
+    $<$<BOOL:${IS_AARCH64_ARCH}>:memcpy_select_aarch64.cpp>
+  DEPS
+    $<$<BOOL:${IS_AARCH64_ARCH}>:folly_external_aor_memcpy_aarch64-use>
+  COMPILE_OPTIONS
+    $<$<BOOL:${IS_AARCH64_ARCH}>:-DFOLLY_MEMCPY_IS_MEMCPY>
 )
 
 # x86 assembly memcpy implementation (not supported on MSVC)
+3 −0
Original line number Diff line number Diff line
@@ -139,6 +139,9 @@ stdenv.mkDerivation (finalAttrs: {

    # <https://github.com/facebook/folly/issues/2171>
    ./folly-fix-glog-0.7.patch

    # https://github.com/facebook/folly/pull/2561
    ./memset-memcpy-aarch64.patch
  ];

  # https://github.com/NixOS/nixpkgs/issues/144170