mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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
This commit is contained in:
parent
d88ea26088
commit
715beee46a
2 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue