Commit 715beee4 authored by Daniel Black's avatar Daniel Black Committed by Daniel Black

MDEV-23051: riscv64 fails build (atomics)

riscv64 fails to build because the use
of #include <atomic> needs to link with -latomic.

per https://github.com/riscv/riscv-gnu-toolchain/issues/183#issuecomment-253721765
parent d88ea260
......@@ -108,9 +108,15 @@ SET(ROCKSDB_SE_SOURCES
# This is a strong requirement coming from RocksDB. No conditional checks here.
#ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX
#)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
SET(ATOMIC_EXTRA_LIBS -latomic)
else()
SET(ATOMIC_EXTRA_LIBS)
endif()
MYSQL_ADD_PLUGIN(rocksdb ${ROCKSDB_SE_SOURCES} MODULE_ONLY STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_rocksdb
LINK_LIBRARIES ${ATOMIC_EXTRA_LIBS}
COMPONENT rocksdb-engine)
IF(NOT TARGET rocksdb)
......@@ -161,6 +167,7 @@ TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
if (UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
# IF (WITH_JEMALLOC)
# FIND_LIBRARY(JEMALLOC_LIBRARY
......
......@@ -132,6 +132,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
set(SYSTEM_LIBS ${SYSTEM_LIBS} -latomic)
endif()
option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment