Skip to content

Commit

Permalink
Merge pull request #342 from WaberZhuang/main
Browse files Browse the repository at this point in the history
fix arm build
  • Loading branch information
yuchen0cc authored Aug 8, 2024
2 parents 3952d6a + 2714777 commit 7093da0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ elif [[ ${OS} =~ "centos" ]]; then
export PATH="/opt/rh/devtoolset-7/root/usr/bin:$PATH"
PACKAGE_RELEASE="-DPACKAGE_RELEASE=${RELEASE_NO}.el7"
COMPILER="-DCMAKE_C_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++"
/opt/rh/devtoolset-7/root/usr/bin/gcc --version
/opt/rh/devtoolset-7/root/usr/bin/g++ --version
elif [[ ${OS} == "centos:8" ]]; then
rm -rf /etc/yum.repos.d/* && curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum install -y gcc gcc-c++

yum install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++
COMPILER="-DCMAKE_C_COMPILER=/opt/rh/gcc-toolset-9/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/gcc-toolset-9/root/usr/bin/g++"
/opt/rh/gcc-toolset-9/root/usr/bin/gcc --version
/opt/rh/gcc-toolset-9/root/usr/bin/g++ --version

PACKAGE_RELEASE="-DPACKAGE_RELEASE=${RELEASE_NO}.el8"
fi
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ project(
)
enable_language(C)

set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -DNDEBUG -g")

# Get CPU arch
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT (${ARCH} STREQUAL x86_64) AND NOT (${ARCH} STREQUAL aarch64) AND NOT (${ARCH} STREQUAL arm64))
Expand All @@ -23,7 +26,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -Wall -Werror=sign-compare")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic -Wall -Werror=sign-compare -DOVERLAYBD_VER=${OBD_VER}")

if (${ARCH} STREQUAL aarch64)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crc -fsigned-char -fno-stack-protector -fomit-frame-pointer")
endif ()

set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc ${CMAKE_CXX_STANDARD_LIBRARIES}")
Expand Down
2 changes: 1 addition & 1 deletion src/overlaybd/zfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_include_directories(crc32_lib PUBLIC
if (${ARCH} STREQUAL x86_64)
target_compile_options(crc32_lib PUBLIC -msse4.2 -mcrc32)
else()
target_compile_options(crc32_lib PUBLIC -march=native -mcpu=generic+crc)
target_compile_options(crc32_lib PRIVATE -march=native -mcpu=generic+crc)
endif()

if(ENABLE_DSA OR ENABLE_ISAL)
Expand Down

0 comments on commit 7093da0

Please sign in to comment.