databases/rocksdb: Fix build on aarch64

util/crc32c_arm64.cc:60:16: error: use of undeclared identifier 'AT_HWCAP'
  elf_aux_info(AT_HWCAP, &auxv, sizeof(auxv));
               ^
util/crc32c_arm64.cc:89:16: error: use of undeclared identifier 'AT_HWCAP'
  elf_aux_info(AT_HWCAP, &auxv, sizeof(auxv));
               ^
2 errors generated.

Reference:	https://pkg-status.freebsd.org/ampere3/data/132arm64-default/1e21f425f6c4/logs/rocksdb-8.11.3.log
Tested on:	ref14-aarch64
This commit is contained in:
Po-Chuan Hsieh 2024-03-23 22:18:09 +08:00
parent ea8cce9c6b
commit 7602c851f1
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
1 changed files with 11 additions and 14 deletions

View File

@ -1,14 +1,11 @@
--- CMakeLists.txt.orig 2021-06-25 21:15:04 UTC
+++ CMakeLists.txt
@@ -612,6 +612,11 @@ if(HAVE_AUXV_GETAUXVAL)
add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
endif()
+check_cxx_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
+if(HAVE_ELF_AUX_INFO)
+ add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT)
+endif()
+
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/include)
if(WITH_FOLLY_DISTRIBUTED_MUTEX)
--- util/crc32c_arm64.cc.orig 2024-02-28 00:24:11 UTC
+++ util/crc32c_arm64.cc
@@ -10,7 +10,7 @@
#if defined(__linux__)
#include <asm/hwcap.h>
#endif
-#ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT
+#if defined(ROCKSDB_AUXV_GETAUXVAL_PRESENT) || defined(__FreeBSD__)
#include <sys/auxv.h>
#endif
#ifndef HWCAP_CRC32