diff --git a/cmake/Env.cmake b/cmake/Env.cmake index ead5127fc3ef1bc669aad589a02f59e16caa1c23..bafdcc3981a9c42ab7956253aec19aa65590cfe8 100644 --- a/cmake/Env.cmake +++ b/cmake/Env.cmake @@ -1,3 +1,7 @@ +include(CMakeFindBinUtils) +EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE) +message(STATUS "DETECT BUILD ARCH: " ${ARCHITECTURE}) + ob_define(DEVTOOLS_DIR "${CMAKE_SOURCE_DIR}/deps/3rd/usr/local/oceanbase/devtools") ob_define(DEP_DIR "${CMAKE_SOURCE_DIR}/deps/3rd/usr/local/oceanbase/deps/devel") @@ -25,6 +29,16 @@ set(DEBUG_PREFIX "-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.") set(LD_OPT "-Wl,--build-id=uuid") set(BUILD_OPT "${DEBUG_PREFIX}") +if(${ARCHITECTURE} STREQUAL "sw_64") + set(OB_USE_CLANG OFF) + set(OB_USE_LLVM_LIBTOOLS OFF) + set(OBJCOPY_BIN "${DEVTOOLS_DIR}/swgcc830_native_tools/usr/bin/objcopy") + set(LD_BIN "${DEVTOOLS_DIR}/swgcc830_native_tools/usr/bin/ld") + set(OB_CC "${DEVTOOLS_DIR}/swgcc830_native_tools/usr/bin/gcc") + set(OB_CXX "${DEVTOOLS_DIR}/swgcc830_native_tools/usr/bin/g++") + set(BUILD_OPT "${BUILD_OPT} --sysroot=${DEVTOOLS_DIR}/swgcc830_native_tools/") +endif() + if (OB_USE_LLVM_LIBTOOLS) # use llvm-ar llvm-ranlib llvm-objcopy ld.lld... set(_CMAKE_TOOLCHAIN_PREFIX llvm-) @@ -79,13 +93,19 @@ if (OB_USE_CLANG) set(CMAKE_SHARED_LINKER_FLAGS "${LD_OPT}") set(CMAKE_EXE_LINKER_FLAGS "${LD_OPT}") -else() # not clang, use gcc52 - find_program(OB_CC gcc - PATHS "${DEVTOOLS_DIR}/bin" - NO_DEFAULT_PATH) - find_program(OB_CXX g++ - PATHS "${DEVTOOLS_DIR}/bin" - NO_DEFAULT_PATH) +else() # not clang, use gcc (such as gcc52 in x86_64) + + if(NOT DEFINED OB_CC) + find_program(OB_CC gcc + PATHS "${DEVTOOLS_DIR}/bin" + NO_DEFAULT_PATH) + endif() + + if(NOT DEFINED OB_CXX) + find_program(OB_CC g++ + PATHS "${DEVTOOLS_DIR}/bin" + NO_DEFAULT_PATH) + endif() set(BUILD_OPT "${BUILD_OPT} -fdiagnostics-color") set(LD_OPT "${LD_OPT} -z noexecstack") @@ -109,9 +129,6 @@ else() message(FATAL_ERROR "COMPILER NOT FOUND") endif() -include(CMakeFindBinUtils) -EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE) -message(STATUS "DETECT BUILD ARCH: " ${ARCHITECTURE}) if(${ARCHITECTURE} STREQUAL "x86_64") set(MTUNE_CFLAGS "-mtune=core2") set(ARCH_LDFLAGS "") @@ -122,6 +139,8 @@ elseif(${ARCHITECTURE} STREQUAL "aarch64") elseif(${ARCHITECTURE} STREQUAL "loongarch64") set(MARCH_CFLAGS "-march=la464" ) set(MTUNE_CFLAGS "-mabi=lp64d" ) +elseif(${ARCHITECTURE} STREQUAL "sw_64") + set(ARCH_LDFLAGS "-latomic -llzma") else() message(FATAL_ERROR "UNSUPPORT BUILD ARCH: ${ARCHITECTURE}") endif() diff --git a/deps/3rd/dep_create.sh b/deps/3rd/dep_create.sh index 9ac4e580df7657db5f4cbe43e3e6c325aa7554a0..0b423a9d48c4d50e59f67f2c7ef0e0af5ea1a1ca 100644 --- a/deps/3rd/dep_create.sh +++ b/deps/3rd/dep_create.sh @@ -87,6 +87,12 @@ function get_os_release() { version_ge "7.0" && OS_RELEASE=7 && return ;; esac + elif [[ "${OS_ARCH}x" == "sw_64x" ]]; then + case "$ID" in + UOS) + version_ge "20" && OS_RELEASE=20 && return + ;; + esac fi not_supported && return 1 } diff --git a/deps/3rd/oceanbase.el20.sw_64.deps b/deps/3rd/oceanbase.el20.sw_64.deps new file mode 100644 index 0000000000000000000000000000000000000000..4d904059e53cec3bc53dfdb67ab8ea2a48c9a06b --- /dev/null +++ b/deps/3rd/oceanbase.el20.sw_64.deps @@ -0,0 +1,24 @@ +[target-default] +os=20 +arch=sw_64 +repo=https://mirrors.aliyun.com/oceanbase/development-kit/uos/20/sw_64/ + +[deps] +devdeps-gtest-1.8.0-1.uos20.sw_64.rpm +devdeps-isa-l-static-2.22.0-1.uos20.sw_64.rpm +devdeps-libcurl-static-7.29.0-1.uos20.sw_64.rpm +devdeps-libunwind-static-1.6.2-1.uos20.sw_64.rpm +devdeps-mariadb-connector-c-3.1.12-1.uos20.sw_64.rpm +devdeps-openssl-static-1.0.1e-1.uos20.sw_64.rpm +devdeps-libaio-0.3.112-1.uos20.sw_64.rpm +devdeps-rapidjson-1.1.0-1.uos20.sw_64.rpm + +[tools] +obdevtools-bison-2.4.1-1.uos20.sw_64.rpm +obdevtools-ccache-3.7.12-1.uos20.sw_64.rpm +obdevtools-cmake-3.20.2-1.uos20.sw_64.rpm +obdevtools-flex-2.5.35-1.uos20.sw_64.rpm +obdevtools-gcc-8.3.0-1.uos20.sw_64.rpm + +[tool-deps] +devdeps-rocksdb-6.22.1-1.uos20.sw_64.rpm diff --git a/deps/easy/src/io/easy_socket.h b/deps/easy/src/io/easy_socket.h index 1af6ad202c1aa89d66497421ccf33728e7cc23d5..91386944a8367c046768ca09fe16083ca32bd4dc 100644 --- a/deps/easy/src/io/easy_socket.h +++ b/deps/easy/src/io/easy_socket.h @@ -24,7 +24,10 @@ EASY_CPP_START #define EASY_FLAGS_REUSEPORT 0x002 #define EASY_FLAGS_SREUSEPORT 0x004 #define EASY_FLAGS_NOLISTEN 0x008 + +#ifndef SO_REUSEPORT #define SO_REUSEPORT 15 +#endif int easy_unix_domain_listen(const char* path, int backlog); int easy_socket_listen(int udp, easy_addr_t* address, int* flags, int backlog); diff --git a/deps/oblib/src/CMakeLists.txt b/deps/oblib/src/CMakeLists.txt index 2c360e17388755cd5e22ff525953a52d04286c9a..6ef735042551a193a3a3c08dc58b3a730df4f7f1 100644 --- a/deps/oblib/src/CMakeLists.txt +++ b/deps/oblib/src/CMakeLists.txt @@ -40,6 +40,16 @@ else() -Wno-psabi -Wno-sign-compare -Wno-unused-variable ${ARCH_COMPILE_OPTIONS} $<$:-Wno-old-style-declaration> $<$:-Wno-literal-suffix -Wno-invalid-offsetof>) + + if(${ARCHITECTURE} STREQUAL "sw_64") + target_compile_options(oblib_base_base + INTERFACE + -Wno-type-limits -Wno-implicit-fallthrough -Wno-deprecated-declarations + -Wno-nonnull-compare -Wno-tautological-compare -Wno-extra -Wno-parentheses + -Wno-memset-elt-size -Wno-comment -Wno-int-in-bool-context -Wno-unused-but-set-parameter + -Wno-ignored-qualifiers -Wno-unused-but-set-variable -Wno-unused-value -Wno-format-truncation + $<$:-Wno-class-memaccess -Wno-aligned-new>) + endif() endif() target_compile_features(oblib_base_base INTERFACE cxx_std_11) diff --git a/deps/oblib/src/lib/charset/ob_charset.cpp b/deps/oblib/src/lib/charset/ob_charset.cpp index 721be2e13e7d692567817144b20956d84db2c375..3a261aaad80fd2817c277362b31e46b583942580 100644 --- a/deps/oblib/src/lib/charset/ob_charset.cpp +++ b/deps/oblib/src/lib/charset/ob_charset.cpp @@ -15,6 +15,7 @@ #include "lib/utility/serialization.h" #include "lib/ob_define.h" #include "lib/worker.h" +#include "math.h" namespace oceanbase { namespace common { diff --git a/deps/oblib/src/lib/json_type/ob_json_bin.h b/deps/oblib/src/lib/json_type/ob_json_bin.h index c2f4983731ca7e2dc91c13fa8de9073ad445ae8a..b7658c5ab8994bd643ee9baf1e41860b0c78e895 100644 --- a/deps/oblib/src/lib/json_type/ob_json_bin.h +++ b/deps/oblib/src/lib/json_type/ob_json_bin.h @@ -460,7 +460,6 @@ private: uint64_t new_val_entry_offset, uint64_t count, uint8_t var_type, int64_t st_pos, ObJsonBuffer &result, ObJBVerType cur_vertype, ObJBVerType dest_vertype) const; - #define JB_PATH_NODE_LEN sizeof(struct ObJBNodeMeta) void stack_update(ObJsonBuffer& stack, uint32_t idx, const ObJBNodeMeta& new_value); int stack_copy(ObJsonBuffer& src, ObJsonBuffer& dst); @@ -519,4 +518,4 @@ public: } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_JSON_BIN \ No newline at end of file +#endif // OCEANBASE_SQL_OB_JSON_BIN