Initial support for loongarch64

Make ClickHouse compilable and runnable on loongarch64

So far only basic functionality was tested (on real hw),
clickhouse server runs, exceptions works, client works,
simple tests works.
This commit is contained in:
qiangxuhui 2024-03-15 03:11:24 +00:00
parent 0fd52c36c6
commit 97a5de9653
27 changed files with 418 additions and 15 deletions

View File

@ -240,11 +240,21 @@ jobs:
data: ${{ needs.RunConfig.outputs.data }}
checkout_depth: 0
BuilderBinS390X:
# disabled because s390x refused to build in the migration to OpenSSL
# BuilderBinS390X:
# needs: [RunConfig, BuilderDebRelease]
# if: ${{ !failure() && !cancelled() }}
# uses: ./.github/workflows/reusable_build.yml
# with:
# build_name: binary_s390x
# data: ${{ needs.RunConfig.outputs.data }}
# checkout_depth: 0
BuilderBinLOONGARCH64:
needs: [RunConfig, BuilderDebRelease]
if: ${{ !failure() && !cancelled() }}
uses: ./.github/workflows/reusable_build.yml
with:
build_name: binary_s390x
build_name: binary_loongarch64
data: ${{ needs.RunConfig.outputs.data }}
checkout_depth: 0
############################################################################################

View File

@ -93,6 +93,8 @@ if (OS MATCHES "Linux"
set (CMAKE_TOOLCHAIN_FILE "cmake/linux/toolchain-ppc64le.cmake" CACHE INTERNAL "")
elseif (ARCH MATCHES "^(s390x.*|S390X.*)")
set (CMAKE_TOOLCHAIN_FILE "cmake/linux/toolchain-s390x.cmake" CACHE INTERNAL "")
elseif (ARCH MATCHES "^(loongarch64.*|LOONGARCH64.*)")
set (CMAKE_TOOLCHAIN_FILE "cmake/linux/toolchain-loongarch64.cmake" CACHE INTERNAL "")
else ()
message (FATAL_ERROR "Unsupported architecture: ${ARCH}")
endif ()

View File

@ -28,8 +28,8 @@
#define NO_INLINE __attribute__((__noinline__))
#define MAY_ALIAS __attribute__((__may_alias__))
#if !defined(__x86_64__) && !defined(__aarch64__) && !defined(__PPC__) && !defined(__s390x__) && !(defined(__riscv) && (__riscv_xlen == 64))
# error "The only supported platforms are x86_64 and AArch64, PowerPC (work in progress), s390x (work in progress) and RISC-V 64 (experimental)"
#if !defined(__x86_64__) && !defined(__aarch64__) && !defined(__PPC__) && !defined(__s390x__) && !(defined(__loongarch64)) && !(defined(__riscv) && (__riscv_xlen == 64))
# error "The only supported platforms are x86_64 and AArch64, PowerPC (work in progress), s390x (work in progress), loongarch64 (experimental) and RISC-V 64 (experimental)"
#endif
/// Check for presence of address sanitizer

View File

@ -120,6 +120,7 @@
#define POCO_ARCH_AARCH64 0x0f
#define POCO_ARCH_ARM64 0x0f // same as POCO_ARCH_AARCH64
#define POCO_ARCH_RISCV64 0x10
#define POCO_ARCH_LOONGARCH64 0x12
#if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
@ -209,6 +210,8 @@
#elif defined(__riscv) && (__riscv_xlen == 64)
# define POCO_ARCH POCO_ARCH_RISCV64
# define POCO_ARCH_LITTLE_ENDIAN 1
#elif defined(__loongarch64)
# define POCO_ARCH POCO_ARCH_LOONGARCH64
#endif

View File

@ -11,6 +11,8 @@ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x.*|S390X.*)")
set (ARCH_S390X 1)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
set (ARCH_RISCV64 1)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64")
set (ARCH_LOONGARCH64 1)
else ()
message (FATAL_ERROR "Platform ${CMAKE_SYSTEM_PROCESSOR} is not supported")
endif ()

View File

@ -0,0 +1,23 @@
# See linux/toolchain-x86_64.cmake for details about multiple load of toolchain file.
include_guard(GLOBAL)
set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set (CMAKE_SYSTEM_NAME "Linux")
set (CMAKE_SYSTEM_PROCESSOR "loongarch64")
set (CMAKE_C_COMPILER_TARGET "loongarch64-linux-gnu")
set (CMAKE_CXX_COMPILER_TARGET "loongarch64-linux-gnu")
set (CMAKE_ASM_COMPILER_TARGET "loongarch64-linux-gnu")
# Adding `-mcmodel=extreme` is to handle the link error:
# relocation R_LARCH_B26 out of range: 194148892 is not in [-134217728, 134217727]
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcmodel=extreme")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -mcmodel=extreme")
set (CMAKE_SYSROOT "${CMAKE_CURRENT_LIST_DIR}/../../contrib/sysroot/linux-loongarch64")
set (TOOLCHAIN_PATH "${CMAKE_CURRENT_LIST_DIR}/../../contrib/sysroot/linux-loongarch64/usr")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --gcc-toolchain=${TOOLCHAIN_PATH}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --gcc-toolchain=${TOOLCHAIN_PATH}")
set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} --gcc-toolchain=${TOOLCHAIN_PATH}")

View File

@ -61,6 +61,21 @@ if (CMAKE_CROSSCOMPILING)
elseif (ARCH_S390X)
set (ENABLE_GRPC OFF CACHE INTERNAL "")
set (ENABLE_RUST OFF CACHE INTERNAL "")
elseif (ARCH_LOONGARCH64)
set (GLIBC_COMPATIBILITY OFF CACHE INTERNAL "")
set (ENABLE_LDAP OFF CACHE INTERNAL "")
set (OPENSSL_NO_ASM ON CACHE INTERNAL "")
set (ENABLE_JEMALLOC OFF CACHE INTERNAL "")
set (ENABLE_PARQUET OFF CACHE INTERNAL "")
set (ENABLE_GRPC OFF CACHE INTERNAL "")
set (ENABLE_HDFS OFF CACHE INTERNAL "")
set (ENABLE_MYSQL OFF CACHE INTERNAL "")
set (ENABLE_RUST OFF CACHE INTERNAL "")
set (ENABLE_LIBPQXX OFF CACHE INTERNAL "")
set (ENABLE_EMBEDDED_COMPILER OFF CACHE INTERNAL "")
set (ENABLE_DWARF_PARSER OFF CACHE INTERNAL "")
set (ENABLE_BLAKE3 OFF CACHE INTERNAL "")
set (COMPILER_CACHE disabled CACHE INTERNAL "")
endif ()
elseif (OS_FREEBSD)
# FIXME: broken dependencies

View File

@ -140,6 +140,12 @@ elseif (ARCH_RISCV64)
"${LIBRARY_DIR}/libs/context/src/asm/make_riscv64_sysv_elf_gas.S"
"${LIBRARY_DIR}/libs/context/src/asm/ontop_riscv64_sysv_elf_gas.S"
)
elseif (ARCH_LOONGARCH64)
set (SRCS_CONTEXT ${SRCS_CONTEXT}
"${LIBRARY_DIR}/libs/context/src/asm/jump_loongarch64_sysv_elf_gas.S"
"${LIBRARY_DIR}/libs/context/src/asm/make_loongarch64_sysv_elf_gas.S"
"${LIBRARY_DIR}/libs/context/src/asm/ontop_loongarch64_sysv_elf_gas.S"
)
elseif(OS_DARWIN)
set (SRCS_CONTEXT ${SRCS_CONTEXT}
"${LIBRARY_DIR}/libs/context/src/asm/jump_x86_64_sysv_macho_gas.S"

View File

@ -66,7 +66,7 @@
#cmakedefine WITH_SASL_OAUTHBEARER 1
#cmakedefine WITH_SASL_CYRUS 1
// crc32chw
#if !defined(__PPC__) && !defined(__riscv) && !defined(__aarch64__) && !defined(__s390x__)
#if !defined(__PPC__) && !defined(__riscv) && !defined(__aarch64__) && !defined(__s390x__) && !defined(__loongarch64)
#define WITH_CRC32C_HW 1
#endif
// regex

View File

@ -110,6 +110,8 @@ if (OS_LINUX)
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/s390x")
elseif (ARCH_RISCV64)
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/riscv64")
elseif (ARCH_LOONGARCH64)
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/loongarch64")
else ()
message(FATAL_ERROR "Platform is not supported")
endif ()

View File

@ -0,0 +1,287 @@
/* Name of package */
#define PACKAGE "libssh"
/* Version number of package */
#define VERSION "0.9.7"
#define SYSCONFDIR "etc"
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/loongarch64"
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
/* Global bind configuration file path */
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
/* Global client configuration file path */
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
/************************** HEADER FILES *************************/
/* Define to 1 if you have the <argp.h> header file. */
/* #undef HAVE_ARGP_H */
/* Define to 1 if you have the <aprpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <glob.h> header file. */
#define HAVE_GLOB_H 1
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
/* #undef HAVE_VALGRIND_VALGRIND_H */
/* Define to 1 if you have the <pty.h> header file. */
/* #undef HAVE_PTY_H */
/* Define to 1 if you have the <utmp.h> header file. */
/* #undef HAVE_UTMP_H */
/* Define to 1 if you have the <util.h> header file. */
/* #undef HAVE_UTIL_H */
/* Define to 1 if you have the <libutil.h> header file. */
/* #undef HAVE_LIBUTIL_H */
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/utime.h> header file. */
/* #undef HAVE_SYS_UTIME_H */
/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <openssl/aes.h> header file. */
#define HAVE_OPENSSL_AES_H 1
/* Define to 1 if you have the <wspiapi.h> header file. */
/* #undef HAVE_WSPIAPI_H */
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
/* #undef HAVE_OPENSSL_BLOWFISH_H */
/* Define to 1 if you have the <openssl/des.h> header file. */
#define HAVE_OPENSSL_DES_H 1
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
#define HAVE_OPENSSL_ECDH_H 1
/* Define to 1 if you have the <openssl/ec.h> header file. */
#define HAVE_OPENSSL_EC_H 1
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
#define HAVE_OPENSSL_ECDSA_H 1
/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1
/* Define to 1 if you have eliptic curve cryptography in openssl */
#define HAVE_OPENSSL_ECC 1
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
/* #undef HAVE_GCRYPT_ECC */
/* Define to 1 if you have eliptic curve cryptography */
#define HAVE_ECC 1
/* Define to 1 if you have DSA */
/* #undef HAVE_DSA */
/* Define to 1 if you have gl_flags as a glob_t sturct member */
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
/* Define to 1 if you have OpenSSL with Ed25519 support */
#define HAVE_OPENSSL_ED25519 1
/* Define to 1 if you have OpenSSL with X25519 support */
#define HAVE_OPENSSL_X25519 1
/*************************** FUNCTIONS ***************************/
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
#define HAVE_OPENSSL_EVP_AES_CTR 1
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
#define HAVE_OPENSSL_EVP_AES_CBC 1
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
/* Define to 1 if you have the `FIPS_mode' function. */
#if USE_BORINGSSL
#define HAVE_OPENSSL_FIPS_MODE 1
#endif
/* Define to 1 if you have the `EVP_DigestSign' function. */
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
/* Define to 1 if you have the `EVP_DigestVerify' function. */
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
/* Define to 1 if you have the `_snprintf' function. */
/* #undef HAVE__SNPRINTF */
/* Define to 1 if you have the `_snprintf_s' function. */
/* #undef HAVE__SNPRINTF_S */
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `_vsnprintf' function. */
/* #undef HAVE__VSNPRINTF */
/* Define to 1 if you have the `_vsnprintf_s' function. */
/* #undef HAVE__VSNPRINTF_S */
/* Define to 1 if you have the `isblank' function. */
#define HAVE_ISBLANK 1
/* Define to 1 if you have the `strncpy' function. */
#define HAVE_STRNCPY 1
/* Define to 1 if you have the `strndup' function. */
#define HAVE_STRNDUP 1
/* Define to 1 if you have the `cfmakeraw' function. */
/* #undef HAVE_CFMAKERAW */
/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1
/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `clock_gettime' function. */
/* #undef HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the `ntohll' function. */
/* #undef HAVE_NTOHLL */
/* Define to 1 if you have the `htonll' function. */
/* #undef HAVE_HTONLL */
/* Define to 1 if you have the `strtoull' function. */
#define HAVE_STRTOULL 1
/* Define to 1 if you have the `__strtoull' function. */
/* #undef HAVE___STRTOULL */
/* Define to 1 if you have the `_strtoui64' function. */
/* #undef HAVE__STRTOUI64 */
/* Define to 1 if you have the `glob' function. */
#define HAVE_GLOB 1
/* Define to 1 if you have the `explicit_bzero' function. */
/* #undef HAVE_EXPLICIT_BZERO 1 */
/* Define to 1 if you have the `memset_s' function. */
/* #undef HAVE_MEMSET_S */
/* Define to 1 if you have the `SecureZeroMemory' function. */
/* #undef HAVE_SECURE_ZERO_MEMORY */
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
/*************************** LIBRARIES ***************************/
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#define HAVE_LIBCRYPTO 1
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
/* #undef HAVE_LIBGCRYPT */
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
/* #undef HAVE_LIBMBEDCRYPTO */
/* Define to 1 if you have the `pthread' library (-lpthread). */
#define HAVE_PTHREAD 1
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
/* #undef HAVE_CMOCKA */
/**************************** OPTIONS ****************************/
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
#define HAVE_UNUSED_ATTRIBUTE 1
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
#define HAVE_COMPILER__FUNC__ 1
#define HAVE_COMPILER__FUNCTION__ 1
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
/* Define to 1 if you want to enable GSSAPI */
/* #undef WITH_GSSAPI */
/* Define to 1 if you want to enable ZLIB */
/* #undef WITH_ZLIB */
/* Define to 1 if you want to enable SFTP */
/* #undef WITH_SFTP */
/* Define to 1 if you want to enable server support */
#define WITH_SERVER 1
/* Define to 1 if you want to enable DH group exchange algorithms */
/* #undef WITH_GEX */
/* Define to 1 if you want to enable blowfish cipher support */
/* #undef WITH_BLOWFISH_CIPHER */
/* Define to 1 if you want to enable debug output for crypto functions */
/* #undef DEBUG_CRYPTO */
/* Define to 1 if you want to enable debug output for packet functions */
/* #undef DEBUG_PACKET */
/* Define to 1 if you want to enable pcap output support (experimental) */
/* #undef WITH_PCAP */
/* Define to 1 if you want to enable calltrace debug output */
/* #undef DEBUG_CALLTRACE */
/* Define to 1 if you want to enable NaCl support */
/* #undef WITH_NACL */
/*************************** ENDIAN *****************************/
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
/* #undef WORDS_BIGENDIAN */

2
contrib/libunwind vendored

@ -1 +1 @@
Subproject commit 40d8eadf96b127d9b22d53ce7a4fc52aaedea965
Subproject commit fa519913b9c157663824bee95c5737669a40eaf3

2
contrib/rocksdb vendored

@ -1 +1 @@
Subproject commit dead55e60b873d5f70f0e9458fbbba2b2180f430
Subproject commit 3a0b80ca9d6eebb38fad7ea3f41dfc9db4f6a984

View File

@ -0,0 +1,32 @@
---
slug: /en/development/build-cross-loongarch
sidebar_position: 70
title: How to Build ClickHouse on Linux for LOONGARCH64 Architecture
sidebar_label: Build on Linux for LOONGARCH64
---
As of writing (2024/03/15) building for loongarch considered to be highly experimental. Not all features can be enabled.
This is for the case when you have Linux machine and want to use it to build `clickhouse` binary that will run on another Linux machine with LOONGARCH64 CPU architecture. This is intended for continuous integration checks that run on Linux servers.
The cross-build for LOONGARCH64 is based on the [Build instructions](../development/build.md), follow them first.
## Install Clang-18
Follow the instructions from https://apt.llvm.org/ for your Ubuntu or Debian setup or do
```
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
```
## Build ClickHouse {#build-clickhouse}
The llvm version required for building must be greater than or equal to 18.1.0.
``` bash
cd ClickHouse
mkdir build-loongarch64
CC=clang-18 CXX=clang++-18 cmake . -Bbuild-loongarch64 -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/linux/toolchain-loongarch64.cmake
ninja -C build-loongarch64
```
The resulting binary will run only on Linux with the LOONGARCH64 CPU architecture.

View File

@ -1,6 +1,6 @@
---
slug: /en/development/contrib
sidebar_position: 72
sidebar_position: 73
sidebar_label: Third-Party Libraries
description: A list of third-party libraries used
---

View File

@ -72,7 +72,7 @@ You can also add original ClickHouse repo address to your local repository to pu
After successfully running this command you will be able to pull updates from the main ClickHouse repo by running `git pull upstream master`.
:::note
Instructions below assume you are building on Linux. If you are cross-compiling or building on macOS, please also check for operating system and architecture specific guides, such as building [on macOS for macOS](build-osx.md), [on Linux for macOS](build-cross-osx.md), [on Linux for Linux/RISC-V](build-cross-riscv.md) and so on.
Instructions below assume you are building on Linux. If you are cross-compiling or building on macOS, please also check for operating system and architecture specific guides, such as building [on macOS for macOS](build-osx.md), [on Linux for macOS](build-cross-osx.md), [on Linux for Linux/RISC-V](build-cross-riscv.md), [on Linux for Linux/LOONGARCH](build-cross-loongarch.md) and so on.
:::
## Build System {#build-system}

View File

@ -1,6 +1,6 @@
---
slug: /en/development/style
sidebar_position: 70
sidebar_position: 71
sidebar_label: C++ Guide
description: A list of recommendations regarding coding style, naming convention, formatting and more
---

View File

@ -1,6 +1,6 @@
---
slug: /en/development/tests
sidebar_position: 71
sidebar_position: 72
sidebar_label: Testing
title: ClickHouse Testing
description: Most of ClickHouse features can be tested with functional tests and they are mandatory to use for every change in ClickHouse code that can be tested that way.

View File

@ -0,0 +1,10 @@
---
slug: /ru/development/build-cross-loongarch
sidebar_position: 69
sidebar_label: Build on Linux for LOONGARCH64
title: Build on Linux for LOONGARCH64
---
import Content from '@site/docs/en/development/build-cross-loongarch.md';
<Content />

View File

@ -1,6 +1,6 @@
---
slug: /ru/development/style
sidebar_position: 69
sidebar_position: 70
sidebar_label: "Как писать код на C++"
---

View File

@ -210,6 +210,8 @@ static void * getCallerAddress(const ucontext_t & context)
return reinterpret_cast<void *>(context.uc_mcontext.__gregs[REG_PC]);
#elif defined(__s390x__)
return reinterpret_cast<void *>(context.uc_mcontext.psw.addr);
#elif defined(__loongarch64)
return reinterpret_cast<void *>(context.uc_mcontext.__pc);
#else
return nullptr;
#endif

View File

@ -361,7 +361,7 @@ void ThreadFuzzer::setup() const
/// Starting from glibc 2.34 there are no internal symbols without version,
/// so not __pthread_mutex_lock but __pthread_mutex_lock@2.2.5
#if defined(OS_LINUX) and !defined(USE_MUSL)
#if defined(OS_LINUX) and !defined(USE_MUSL) and !defined(__loongarch64)
/// You can get version from glibc/sysdeps/unix/sysv/linux/$ARCH/$BITS_OR_BYTE_ORDER/libc.abilist
#if defined(__amd64__)
# define GLIBC_SYMVER "GLIBC_2.2.5"
@ -383,7 +383,8 @@ void ThreadFuzzer::setup() const
GLIBC_COMPAT_SYMBOL(__pthread_mutex_lock)
#endif
#if defined(ADDRESS_SANITIZER)
/// The loongarch64's glibc_version is 2.36
#if defined(ADDRESS_SANITIZER) || defined(__loongarch64)
#if USE_JEMALLOC
#error "ASan cannot be used with jemalloc"
#endif

View File

@ -46,6 +46,8 @@ namespace ErrorCodes
#define __NR_renameat2 357
#elif defined(__riscv)
#define __NR_renameat2 276
#elif defined(__loongarch64)
#define __NR_renameat2 276
#else
#error "Unsupported architecture"
#endif

View File

@ -47,6 +47,8 @@ enum PollPidResult
#define SYS_pidfd_open 434
#elif defined(__s390x__)
#define SYS_pidfd_open 434
#elif defined(__loongarch64)
#define SYS_pidfd_open 434
#else
#error "Unsupported architecture"
#endif

View File

@ -79,7 +79,7 @@ inline void copyOverlap8(UInt8 * op, const UInt8 *& match, size_t offset)
}
#if defined(__x86_64__) || defined(__PPC__) || defined(__s390x__) || defined(__riscv)
#if defined(__x86_64__) || defined(__PPC__) || defined(__s390x__) || defined(__riscv) || defined(__loongarch64)
/** We use 'xmm' (128bit SSE) registers here to shuffle 16 bytes.
*
@ -268,7 +268,7 @@ inline void copyOverlap16(UInt8 * op, const UInt8 *& match, const size_t offset)
}
#if defined(__x86_64__) || defined(__PPC__) || defined(__s390x__) || defined (__riscv)
#if defined(__x86_64__) || defined(__PPC__) || defined(__s390x__) || defined (__riscv) || defined(__loongarch64)
inline void copyOverlap16Shuffle(UInt8 * op, const UInt8 *& match, const size_t offset)
{

View File

@ -36,6 +36,8 @@
#define SYS_preadv2 380
#elif defined(__riscv)
#define SYS_preadv2 286
#elif defined(__loongarch64)
#define SYS_preadv2 286
#else
#error "Unsupported architecture"
#endif

View File

@ -475,6 +475,7 @@ LLDB
LLVM's
LOCALTIME
LOCALTIMESTAMP
LOONGARCH
LONGLONG
Levenshtein
Liao
@ -1910,6 +1911,7 @@ logTrace
logagent
loghouse
london
loongarch
lookups
lowcardinality
lowerUTF