Skip to content
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

Support arm in linux #125

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ if(NOT SILKWORM_HAS_PARENT)
CACHE FILEPATH "" FORCE
)
endif()

include(cmake/conan.cmake)

endif()

project(silkworm)
set(PROJECT_VERSION 0.1.0-dev)

# conan must be initiailzed after project definition to properly detect target architecture.
if(NOT SILKWORM_HAS_PARENT)
include(cmake/conan.cmake)
endif()

include(CableBuildInfo)

string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ ${PROJECT_VERSION})
Expand Down
6 changes: 5 additions & 1 deletion cmake/conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

function(guess_conan_profile)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(PROFILE linux_gcc_11_release)
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(PROFILE linux_arm_gcc_11_release)
else()
set(PROFILE linux_gcc_11_release)
endif()
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(PROFILE macos_arm_clang_13_release)
Expand Down
12 changes: 12 additions & 0 deletions cmake/profiles/linux_arm_gcc_11_debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[settings]
os=Linux
os_build=Linux
arch=armv8
arch_build=armv8
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Debug
[options]
[build_requires]
[env]
12 changes: 12 additions & 0 deletions cmake/profiles/linux_arm_gcc_11_release
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[settings]
os=Linux
os_build=Linux
arch=armv8
arch_build=armv8
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
7 changes: 7 additions & 0 deletions silkworm/silkrpc/commands/ots_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
#include <silkworm/silkrpc/ethdb/transaction_database.hpp>
#include <silkworm/silkrpc/json/types.hpp>

// GCC in this setting will report mismatch in new delete when checking dtor of boost::asio::awaitable.
// Possibly cuased by GCC process ctor as inline but not for dtor. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100485
// Any more fine-grained fix will need toching the boost files. So we supress the warning here.
// As for now, GCC does not report such warning in other architecture. So we can still rely on this check on other platform for protection.
#ifdef __aarch64__
#pragma GCC diagnostic ignored "-Wmismatched-new-delete"
#endif
namespace silkworm::rpc::commands {

constexpr int kCurrentApiLevel{8};
Expand Down
Loading