Skip to content

Commit

Permalink
Merge pull request #125 from eosnetworkfoundation/yarkin/support_arm_…
Browse files Browse the repository at this point in the history
…linux

Support arm in linux
  • Loading branch information
yarkinwho authored Feb 27, 2024
2 parents dd05bab + 4c6f4e2 commit 8a2b691
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
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

0 comments on commit 8a2b691

Please sign in to comment.