support aarch64 compilation
This commit is contained in:

committed by
LINxiansheng

parent
e0748037b0
commit
db025266d4
@ -115,6 +115,10 @@ message(STATUS "DETECT BUILD ARCH: " ${ARCHITECTURE})
|
|||||||
if(${ARCHITECTURE} STREQUAL "x86_64")
|
if(${ARCHITECTURE} STREQUAL "x86_64")
|
||||||
set(MTUNE_CFLAGS "-mtune=core2")
|
set(MTUNE_CFLAGS "-mtune=core2")
|
||||||
set(ARCH_LDFLAGS "")
|
set(ARCH_LDFLAGS "")
|
||||||
|
elseif(${ARCHITECTURE} STREQUAL "aarch64")
|
||||||
|
set(MARCH_CFLAGS "-march=armv8-a+crc" )
|
||||||
|
set(MTUNE_CFLAGS "-mtune=generic" )
|
||||||
|
set(ARCH_LDFLAGS "-latomic")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "UNSUPPORT BUILD ARCH: ${ARCHITECTURE}")
|
message(FATAL_ERROR "UNSUPPORT BUILD ARCH: ${ARCHITECTURE}")
|
||||||
endif()
|
endif()
|
||||||
|
19
deps/3rd/dep_create.sh
vendored
19
deps/3rd/dep_create.sh
vendored
@ -14,7 +14,8 @@ fi
|
|||||||
|
|
||||||
source /etc/os-release || exit 1
|
source /etc/os-release || exit 1
|
||||||
|
|
||||||
PNAME=${PRETTY_NAME:-${NAME} ${VERSION}}
|
PNAME=${PRETTY_NAME:-"${NAME} ${VERSION}"}
|
||||||
|
PNAME="${PNAME} (${OS_ARCH})"
|
||||||
|
|
||||||
function compat_centos8() {
|
function compat_centos8() {
|
||||||
echo "[NOTICE] '$PNAME' is compatible with CentOS 8, use el8 dependencies list"
|
echo "[NOTICE] '$PNAME' is compatible with CentOS 8, use el8 dependencies list"
|
||||||
@ -35,7 +36,11 @@ function version_ge() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_os_release() {
|
function get_os_release() {
|
||||||
|
if [[ "${OS_ARCH}x" == "x86_64x" ]]; then
|
||||||
case "$ID" in
|
case "$ID" in
|
||||||
|
alinux)
|
||||||
|
version_ge "2.1903" && compat_centos7 && return
|
||||||
|
;;
|
||||||
alios)
|
alios)
|
||||||
version_ge "8.0" && compat_centos8 && return
|
version_ge "8.0" && compat_centos8 && return
|
||||||
version_ge "7.2" && compat_centos7 && return
|
version_ge "7.2" && compat_centos7 && return
|
||||||
@ -67,10 +72,18 @@ function get_os_release() {
|
|||||||
uos)
|
uos)
|
||||||
version_ge "20" && compat_centos7 && return
|
version_ge "20" && compat_centos7 && return
|
||||||
;;
|
;;
|
||||||
alinux)
|
esac
|
||||||
version_ge "2.1903" && compat_centos7 && return
|
elif [[ "${OS_ARCH}x" == "aarch64x" ]]; then
|
||||||
|
case "$ID" in
|
||||||
|
alios)
|
||||||
|
version_ge "7.0" && compat_centos7 && return
|
||||||
|
;;
|
||||||
|
centos)
|
||||||
|
version_ge "8.0" && compat_centos7 && return
|
||||||
|
version_ge "7.0" && OS_RELEASE=7 && return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
not_supported && return 1
|
not_supported && return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
22
deps/3rd/oceanbase.el7.aarch64.deps
vendored
Normal file
22
deps/3rd/oceanbase.el7.aarch64.deps
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[target]
|
||||||
|
os=7
|
||||||
|
arch=aarch64
|
||||||
|
repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/7/x86_64/
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
devdeps-gtest-1.8.0-3.el7.aarch64.rpm
|
||||||
|
devdeps-isa-l-static-2.22.0-3.el7.aarch64.rpm
|
||||||
|
devdeps-libcurl-static-7.29.0-3.el7.aarch64.rpm
|
||||||
|
devdeps-libunwind-static-1.5.0-3.el7.aarch64.rpm
|
||||||
|
devdeps-mariadb-connector-c-3.1.12-3.el7.aarch64.rpm
|
||||||
|
devdeps-openssl-static-1.0.1e-3.el7.aarch64.rpm
|
||||||
|
devdeps-libaio-0.3.112-3.el7.aarch64.rpm
|
||||||
|
|
||||||
|
[tools]
|
||||||
|
obdevtools-bintuils-2.30-3.el7.aarch64.rpm
|
||||||
|
obdevtools-bison-2.4.1-3.el7.aarch64.rpm
|
||||||
|
obdevtools-ccache-3.7.12-3.el7.aarch64.rpm
|
||||||
|
obdevtools-cmake-3.20.2-3.el7.aarch64.rpm
|
||||||
|
obdevtools-flex-2.5.35-3.el7.aarch64.rpm
|
||||||
|
obdevtools-gcc-5.2.0-3.el7.aarch64.rpm
|
||||||
|
obdevtools-llvm-11.0.1-3.el7.aarch64.rpm
|
10
deps/easy/CMakeLists.txt
vendored
10
deps/easy/CMakeLists.txt
vendored
@ -26,10 +26,16 @@ target_include_directories(
|
|||||||
${DEP_DIR}/include
|
${DEP_DIR}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(EASY_ARCH_COMPILE_OPTIONS "")
|
||||||
|
if(${ARCHITECTURE} STREQUAL "aarch64")
|
||||||
|
set(EASY_ARCH_COMPILE_OPTIONS -Wno-tautological-constant-out-of-range-compare)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (OB_USE_CLANG)
|
if (OB_USE_CLANG)
|
||||||
set(EASY_CC_WNO -fno-strict-aliasing -Wno-unused-variable -Wno-unused-function -fmax-type-align=8)
|
set(EASY_CC_WNO -fno-strict-aliasing -Wno-unused-variable -Wno-unused-function -fmax-type-align=8 ${EASY_ARCH_COMPILE_OPTIONS})
|
||||||
else()
|
else()
|
||||||
set(EASY_CC_WNO -fno-strict-aliasing -Wno-unused-variable -Wno-implicit-function-declaration -Wno-unused-but-set-variable -Wno-unused-function)
|
set(EASY_CC_WNO -fno-strict-aliasing -Wno-unused-variable -Wno-implicit-function-declaration -Wno-unused-but-set-variable -Wno-unused-function ${EASY_ARCH_COMPILE_OPTIONS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
10
deps/oblib/src/CMakeLists.txt
vendored
10
deps/oblib/src/CMakeLists.txt
vendored
@ -10,6 +10,10 @@ target_include_directories(
|
|||||||
${DEP_DIR}/include
|
${DEP_DIR}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(ARCH_COMPILE_OPTIONS "")
|
||||||
|
if(${ARCHITECTURE} STREQUAL "aarch64")
|
||||||
|
set(ARCH_COMPILE_OPTIONS -Wno-extern-c-compat -Wno-atomic-alignment)
|
||||||
|
endif()
|
||||||
if (OB_USE_CLANG)
|
if (OB_USE_CLANG)
|
||||||
target_compile_options(oblib_base_base
|
target_compile_options(oblib_base_base
|
||||||
INTERFACE
|
INTERFACE
|
||||||
@ -24,14 +28,16 @@ if (OB_USE_CLANG)
|
|||||||
-Wno-format-security -Wno-reserved-user-defined-literal -Wno-sometimes-uninitialized
|
-Wno-format-security -Wno-reserved-user-defined-literal -Wno-sometimes-uninitialized
|
||||||
-Wno-unused-value -Wno-self-assign -Wno-overloaded-virtual
|
-Wno-unused-value -Wno-self-assign -Wno-overloaded-virtual
|
||||||
-Wno-unused-private-field -Wno-mismatched-tags -Wno-unused-variable
|
-Wno-unused-private-field -Wno-mismatched-tags -Wno-unused-variable
|
||||||
-Wno-invalid-offsetof -Wno-tautological-compare -Wno-psabi -Wno-c99-designator)
|
-Wno-invalid-offsetof -Wno-tautological-compare -Wno-psabi -Wno-c99-designator
|
||||||
|
${ARCH_COMPILE_OPTIONS}
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
target_compile_options(oblib_base_base
|
target_compile_options(oblib_base_base
|
||||||
INTERFACE
|
INTERFACE
|
||||||
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
|
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
|
||||||
-D_NO_EXCEPTION -Wall -Wno-unused-parameter -Wextra -Wformat -Wno-deprecated
|
-D_NO_EXCEPTION -Wall -Wno-unused-parameter -Wextra -Wformat -Wno-deprecated
|
||||||
-fno-strict-aliasing -fno-omit-frame-pointer ${MARCH_CFLAGS} ${MTUNE_CFLAGS}
|
-fno-strict-aliasing -fno-omit-frame-pointer ${MARCH_CFLAGS} ${MTUNE_CFLAGS}
|
||||||
-Wno-psabi -Wno-sign-compare -Wno-unused-variable
|
-Wno-psabi -Wno-sign-compare -Wno-unused-variable ${ARCH_COMPILE_OPTIONS}
|
||||||
$<$<COMPILE_LANGUAGE:C>:-Wno-old-style-declaration>
|
$<$<COMPILE_LANGUAGE:C>:-Wno-old-style-declaration>
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:-Wno-literal-suffix -Wno-invalid-offsetof>)
|
$<$<COMPILE_LANGUAGE:CXX>:-Wno-literal-suffix -Wno-invalid-offsetof>)
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user