loongarch64

This commit is contained in:
2024-05-21 16:44:47 +08:00
parent f087fdd39f
commit 31d5ead568
3 changed files with 26 additions and 3 deletions

View File

@@ -5,6 +5,12 @@ set -e
SCRIPT_PATH=$(cd $(dirname $0) && pwd)
PROJECT_ROOT_PATH=$(cd ${SCRIPT_PATH}/.. && pwd)
BUILD_TUPLE=$(uname -p)
if [ x"$BUILD_TUPLE" = x"loongarch64" ]; then
export GCC="8.3"
else
export GCC="7.3"
fi
export COMPONENT="CM"
export VERSION_MODE="release"
export THIRD="${PROJECT_ROOT_PATH}/binarylibs"
@@ -17,7 +23,7 @@ export MULTIPLE_NODES="ON"
export OPEN_SOURCE_MODE="inc"
export LIBPQ="ON"
export KRB="OFF"
export GCC="7.3"
export PRIVATEGAUSS="ON"
export ALARM="ON"
@@ -120,7 +126,8 @@ function gcc_env() {
fi
export CC=$GCC_INSTALL_HOME/bin/gcc
export CXX=$GCC_INSTALL_HOME/bin/g++
export LD_LIBRARY_PATH=${GCC_INSTALL_HOME}/lib64:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=/opt/rh/devtoolset-10/root/usr/lib:${GCC_INSTALL_HOME}/lib64:${LD_LIBRARY_PATH}
}
function compile_open_source() {

View File

@@ -50,7 +50,7 @@ typedef struct st_spin_statis {
uint64 fails;
} spin_statis_t;
#if defined(__arm__) || defined(__aarch64__)
#if defined(__arm__) || defined(__aarch64__) || defined(__loongarch__)
#define fas_cpu_pause() \
do { \
__asm__ volatile("nop"); \

View File

@@ -379,6 +379,22 @@ static __inline__ int tas(volatile slock_t* lock)
#endif /* HAVE_GCC_INT_ATOMICS */
#endif /* __arm__ */
#if defined(__loongarch__)
#define HAS_TEST_AND_SET
#define TAS(lock) tas(lock)
typedef int slock_t;
static __inline__ int
tas(volatile slock_t *lock)
{
return __sync_lock_test_and_set(lock, 1);
}
#define S_UNLOCK(lock) __sync_lock_release(lock)
#endif /* __loongarch__ */
/* S/390 and S/390x Linux (32- and 64-bit zSeries) */
#if defined(__s390__) || defined(__s390x__)
#define HAS_TEST_AND_SET