fix build error

This commit is contained in:
Xiaotian Wu 2025-01-07 19:58:10 +08:00
parent 822a442d09
commit 1abcb356dc
8 changed files with 40 additions and 18 deletions

View File

@ -87,6 +87,8 @@ static __inline__ void easy_spin_lock(easy_atomic_t *lock)
__asm__ (".byte 0xf3, 0x90");
#elif defined(__aarch64__)
__asm__ ("yield"); // for ARM
#elif defined(__loongarch_lp64)
__asm__ ("ibar 0"); // for ARM
#else
#error arch unsupported
#endif

View File

@ -483,6 +483,19 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
libgomp_static.a
libroaring.a
)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "loongarch64")
target_link_libraries(oblib_lib
PUBLIC
libob_vsag_static.a
libcpuinfo.a
libsimd.a
libvsag_static.a
libdiskann.a
libopenblas.a
libgfortran_static.a
libgomp_static.a
libroaring.a
)
else()
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

View File

@ -30,6 +30,9 @@ namespace common
#elif defined(__aarch64__)
#define WEAK_BARRIER() __sync_synchronize()
#define PAUSE() ({OB_ATOMIC_EVENT(atomic_pause); asm("yield\n");}) // for ARM
#elif defined(__loongarch_lp64)
#define WEAK_BARRIER() __sync_synchronize()
#define PAUSE() ({OB_ATOMIC_EVENT(atomic_pause); asm("dbar 0\n");}) // for ARM
#else
#error arch unsupported
#endif

View File

@ -612,6 +612,8 @@ for (__typeof__((c).at(0)) *it = ((extra_condition) && (c).count() > 0 ? &(c).at
#define CACHE_ALIGN_SIZE 64
#elif __aarch64__
#define CACHE_ALIGN_SIZE 128
#elif __loongarch_lp64
#define CACHE_ALIGN_SIZE 64
#endif
#define CACHE_ALIGNED __attribute__((aligned(CACHE_ALIGN_SIZE)))

View File

@ -1,5 +1,6 @@
SET(GEN_PARSER_SCRIPT ${CMAKE_SOURCE_DIR}/src/pl/parser/gen_parser.sh)
execute_process(
COMMAND env NEED_PARSER_CACHE=${NEED_PARSER_CACHE} bash gen_parser.sh
COMMAND env NEED_PARSER_CACHE=${NEED_PARSER_CACHE} bash ${GEN_PARSER_SCRIPT}
RESULT_VARIABLE RET
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/pl/parser
OUTPUT_FILE _gen_pl_parser.output

View File

@ -8,17 +8,17 @@ set +x
CURDIR="$(dirname $(readlink -f "$0"))"
#export PATH=/usr/local/bin:$PATH
export PATH=$CURDIR/../../../deps/3rd/usr/local/oceanbase/devtools/bin/:$PATH
export BISON_PKGDATADIR=$CURDIR/../../../deps/3rd/usr/local/oceanbase/devtools/share/bison
#export BISON_PKGDATADIR=$CURDIR/../../../deps/3rd/usr/local/oceanbase/devtools/share/bison
CACHE_MD5_FILE=$CURDIR/_MD5
TEMP_FILE=$(mktemp)
BISON_VERSION=`bison -V| grep 'bison (GNU Bison)'|awk '{ print $4;}'`
NEED_VERSION='2.4.1'
if [ "$BISON_VERSION" != "$NEED_VERSION" ]; then
echo "bison version not match, please use bison-$NEED_VERSION"
exit 1
fi
#if [ "$BISON_VERSION" != "$NEED_VERSION" ]; then
# echo "bison version not match, please use bison-$NEED_VERSION"
# exit 1
#fi
bison_parser() {
BISON_OUTPUT="$(bison -v -Werror -d $1 -o $2 2>&1)"
@ -75,4 +75,4 @@ else
generate_parser
fi
rm -rf $TEMP_FILE
rm -rf $TEMP_FILE

View File

@ -13,11 +13,11 @@
//first: declare
%define api.pure
%parse-param {ObParseCtx *parse_ctx}
%name-prefix "obpl_mysql_yy"
%define api.prefix {obpl_mysql_yy}
%locations
//%no-lines
%verbose
%error-verbose
%define parse.error verbose
%{
#include <stdint.h>

View File

@ -6,9 +6,9 @@
#
set +x
CURDIR="$(dirname $(readlink -f "$0"))"
#export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/bin:$PATH
export PATH=$CURDIR/../../../deps/3rd/usr/local/oceanbase/devtools/bin/:$PATH
export BISON_PKGDATADIR=$CURDIR/../../../deps/3rd/usr/local/oceanbase/devtools/share/bison
#export BISON_PKGDATADIR=$CURDIR/../../../deps/3rd/usr/local/oceanbase/devtools/share/bison
CACHE_MD5_FILE=$CURDIR/_MD5
TEMP_FILE=$(mktemp)
@ -16,13 +16,14 @@ BISON_VERSION=`bison -V| grep 'bison (GNU Bison)'|awk '{ print $4;}'`
NEED_VERSION='2.4.1'
# generate sql_parser
bison -v -d ../../../src/sql/parser/sql_parser_mysql_mode.y -o ../../../src/sql/parser/sql_parser_mysql_mode_tab.c
BISON_RETURN="$?"
if [ $BISON_RETURN -ne 0 ]
then
echo Compile error[$BISON_RETURN], abort.
exit 1
fi
#mkdir -p ../../../src/sql/parser
#bison -v -d ../../../src/sql/parser/sql_parser_mysql_mode.y -o ../../../src/sql/parser/sql_parser_mysql_mode_tab.c
#BISON_RETURN="$?"
#if [ $BISON_RETURN -ne 0 ]
#then
# echo Compile error[$BISON_RETURN], abort.
# exit 1
#fi
cat ../../../src/sql/parser/sql_parser_mysql_mode.y >> $TEMP_FILE
cat ../../../src/sql/parser/sql_parser_mysql_mode.l >> $TEMP_FILE