| From d88ea260882ca414e940cd6af225617f00503f71 Mon Sep 17 00:00:00 2001 |
| From: Krunal Bauskar <krunalbauskar@gmail.com> |
| Date: Mon, 27 Jul 2020 18:38:10 +0800 |
| Subject: [PATCH] MDEV-23137: RocksDB: undefined reference to crc32c_arm64 |
| |
| RocksDB fails to build on arm64: undefined reference to |
| `crc32c_arm64(unsigned int, unsigned char const*, unsigned int)' |
| |
| MariaDB uses storage/rocksdb/build_rocksdb.cmake to compile RocksDB. |
| Said cmake missed adding crc32c_arm64 compilation target so if |
| machine native architecture supported crc32 then complier would enable |
| usage of function defined in crc32c_arm64 causing the listed error. |
| |
| Added crc32c_arm64 complition target. |
| |
| closes #1642 |
| |
| Upstream-Status: Backport |
| |
| Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
| --- |
| storage/rocksdb/build_rocksdb.cmake | 10 ++++++++++ |
| 1 file changed, 10 insertions(+) |
| |
| diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake |
| index 3f3dca7e990..7d2252c5f77 100644 |
| --- a/storage/rocksdb/build_rocksdb.cmake |
| +++ b/storage/rocksdb/build_rocksdb.cmake |
| @@ -442,6 +442,16 @@ else() |
| util/crc32c_ppc.c |
| util/crc32c_ppc_asm.S) |
| endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") |
| + # aarch |
| + if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64") |
| + CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC) |
| + if(HAS_ARMV8_CRC) |
| + message(STATUS " HAS_ARMV8_CRC yes") |
| + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crc+crypto -Wno-unused-function") |
| + list(APPEND ROCKSDB_SOURCES |
| + util/crc32c_arm64.cc) |
| + endif(HAS_ARMV8_CRC) |
| + endif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64") |
| endif() |
| SET(SOURCES) |
| FOREACH(s ${ROCKSDB_SOURCES}) |
| -- |
| 2.17.1 |
| |