提交 9175be16 编写于 作者: W wenxingsen 提交者: wangzelin.wzl

support sw_64 arch build

上级 addaaac2
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()
......@@ -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
}
......
[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
......@@ -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);
......
......@@ -40,6 +40,16 @@ else()
-Wno-psabi -Wno-sign-compare -Wno-unused-variable ${ARCH_COMPILE_OPTIONS}
$<$<COMPILE_LANGUAGE:C>:-Wno-old-style-declaration>
$<$<COMPILE_LANGUAGE:CXX>:-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
$<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess -Wno-aligned-new>)
endif()
endif()
target_compile_features(oblib_base_base INTERFACE cxx_std_11)
......
......@@ -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 {
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册