From 47a1b9aaa308ebca7d1e5d246b3365f61a93669c Mon Sep 17 00:00:00 2001 From: mask <5113279+maskshell@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:44:09 +0800 Subject: [PATCH] Update OpenSSL to 3.0 and optimize for ARM building. --- CMakeLists.txt | 10 ++++++++-- build.sh | 14 +++++++------- {dep => deb}/build.sh | 0 {dep => deb}/rocketmq_amd64/DEBIAN/control | 0 {dep => deb}/rocketmq_amd64/DEBIAN/postinst | 0 5 files changed, 15 insertions(+), 9 deletions(-) rename {dep => deb}/build.sh (100%) rename {dep => deb}/rocketmq_amd64/DEBIAN/control (100%) rename {dep => deb}/rocketmq_amd64/DEBIAN/postinst (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index baa227d0d..3aa7df445 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,8 +185,14 @@ ELSE () if (CMAKE_BUILD_BITS EQUAL 32) list(APPEND CXX_FLAGS "-m32") - else () #not-condition - list(APPEND CXX_FLAGS "-m64") + else () + if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + list(APPEND CXX_FLAGS "-m64") + endif () + endif () + + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch32") + list(APPEND CXX_FLAGS "-march=armv8-a") endif () string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}") diff --git a/build.sh b/build.sh index be500a6cd..c4f3b17be 100755 --- a/build.sh +++ b/build.sh @@ -29,10 +29,10 @@ declare fname_openssl="openssl*.tar.gz" declare fname_libevent="libevent*.zip" declare fname_jsoncpp="jsoncpp*.zip" declare fname_boost="boost*.tar.gz" -declare fname_openssl_down="openssl-1.1.1d.tar.gz" -declare fname_libevent_down="release-2.1.11-stable.zip" +declare fname_openssl_down="openssl-3.0.15.tar.gz" +declare fname_libevent_down="release-2.1.12-stable.zip" declare fname_jsoncpp_down="0.10.7.zip" -declare fname_boost_down="1.78.0/boost_1_78_0.tar.gz" +declare fname_boost_down="1.84.0/boost_1_84_0.tar.gz" PrintParams() { echo "=========================================one key build help============================================" @@ -212,7 +212,7 @@ BuildOpenSSL() { if [ -e ${fname_openssl} ]; then echo "${fname_openssl} exists" else - wget https://www.openssl.org/source/old/1.1.1/${fname_openssl_down} -O ${fname_openssl_down} --no-check-certificate + wget https://www.openssl.org/source/old/3.0/${fname_openssl_down} -O ${fname_openssl_down} --no-check-certificate fi tar -zxvf ${fname_openssl} &> unzipopenssl.txt if [ $? -ne 0 ]; then @@ -226,9 +226,9 @@ BuildOpenSSL() { fi echo "build openssl static #####################" if [ $verbose -eq 0 ]; then - ./config shared CFLAGS=-fPIC CPPFLAGS=-fPIC --prefix=${install_lib_dir} --openssldir=${install_lib_dir} &> opensslconfig.txt + ./config shared CFLAGS=-fPIC CPPFLAGS=-fPIC --prefix=${install_lib_dir} --openssldir=${install_lib_dir} enable-camellia enable-seed enable-rfc3779 enable-cms enable-md2 enable-rc5 nable-weak-ssl-ciphers enable-ssl3 enable-ssl3-method enable-md2 enable-ktls enable-fips &> opensslconfig.txt else - ./config shared CFLAGS=-fPIC CPPFLAGS=-fPIC --prefix=${install_lib_dir} --openssldir=${install_lib_dir} + ./config shared CFLAGS=-fPIC CPPFLAGS=-fPIC --prefix=${install_lib_dir} --openssldir=${install_lib_dir} enable-camellia enable-seed enable-rfc3779 enable-cms enable-md2 enable-rc5 enable-weak-ssl-ciphers enable-ssl3 enable-ssl3-method enable-md2 enable-ktls enable-fips fi if [ $? -ne 0 ]; then exit 1 @@ -342,7 +342,7 @@ BuildJsonCPP() { echo "build jsoncpp success." if [ ! -f ${install_lib_dir}/lib/libjsoncpp.a ]; then echo " ./bin/lib directory is not libjsoncpp.a" - cp ${install_lib_dir}/lib/x86_64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/ + cp ${install_lib_dir}/lib/$(uname -m)-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/ fi } diff --git a/dep/build.sh b/deb/build.sh similarity index 100% rename from dep/build.sh rename to deb/build.sh diff --git a/dep/rocketmq_amd64/DEBIAN/control b/deb/rocketmq_amd64/DEBIAN/control similarity index 100% rename from dep/rocketmq_amd64/DEBIAN/control rename to deb/rocketmq_amd64/DEBIAN/control diff --git a/dep/rocketmq_amd64/DEBIAN/postinst b/deb/rocketmq_amd64/DEBIAN/postinst similarity index 100% rename from dep/rocketmq_amd64/DEBIAN/postinst rename to deb/rocketmq_amd64/DEBIAN/postinst