-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #194] Fix build error on aarch64/arm platform #338
base: master
Are you sure you want to change the base?
Conversation
@@ -29,7 +29,7 @@ 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_openssl_down="openssl-1.1.1i.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have sufficient test with 1.1i?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no. I don't have any idea to make sure 1.1.1i make everything right but it passed build.sh ExecutionTesting process and I use the .so/.a with python client in some simple scenarios (push/pull consumer and producer) on arm/x86_64. It all works fine. Maybe some more tests should be done but I can't find any documents or resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your honesty, this pr will be followed up by the community for a long time until a convincible security test. I'm happy to follow up on it. If you have compilation problems, you could use the patch to bypass software defects :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That's the best way to ensure stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many existing cves in 1.1.1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenSSL is supposed to be dynamically linked. SDK should not care about the version of OpenSSL that is eventually used as long as they share compatible ABI.
CMakeLists.txt
Outdated
list(APPEND CXX_FLAGS "-m64") | ||
endif () | ||
option(BUILD_FOR_ARM "Build for arm64 platform" ON) | ||
if (NOT ${BUILD_FOR_ARM} MATCHES "ON") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no “matches” is ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
build.sh
Outdated
if [ "$(uname -m)" = "aarch64" ]; then | ||
cp ${install_lib_dir}/lib/aarch64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/ | ||
else | ||
cp ${install_lib_dir}/lib/x86_64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems "$(uname -m)-linux-gnu" is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I will fix it.
@@ -29,7 +29,7 @@ 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_openssl_down="openssl-1.1.1i.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many existing cves in 1.1.1d
else () #not-condition | ||
list(APPEND CXX_FLAGS "-m64") | ||
endif () | ||
option(BUILD_FOR_ARM "Build for arm64 platform" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not detect the Arm platform and if it's Arm then skip this code instead of having a build option that means people building for Arm need to know to set this?
else | ||
./b2 -j$cpu_num cflags=-fPIC cxxflags=-fPIC --with-atomic --with-thread --with-system --with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem --with-locale --with-iostreams threading=multi link=static release install --prefix=${install_lib_dir} | ||
if [ "$(uname -m)" = "aarch64" ]; then | ||
./b2 -j$cpu_num cflags=-fPIC cxxflags=-fPIC --with-atomic --with-thread --with-system --with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem --with-locale --with-iostreams threading=multi link=static release install --prefix=${install_lib_dir} architecture=arm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it necessary to pass architecture=arm when building boost natively?
What other problems are there at the moment? It is still necessary for some users to use it on a Mac arm. |
What is the purpose of the change
Fix build error on aarch64 platform
Brief changelog
The build.sh runs failed on arm64. I checked and fix some error, add some judgement logic on the point which could failed on arm64.
BUILD_FOR_ARM
and when it is ON there will no -m32/64 parameter which lead build error on arm. In build.sh we should add this option when detect arm platform.architecture
for build arm. When we build from arm we should add it.Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.