diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d5ac0ad1..212e3eec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/cmake/conan.cmake b/cmake/conan.cmake index 3f5afacd6..187e65968 100644 --- a/cmake/conan.cmake +++ b/cmake/conan.cmake @@ -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) diff --git a/cmake/profiles/linux_arm_gcc_11_debug b/cmake/profiles/linux_arm_gcc_11_debug new file mode 100644 index 000000000..93d21f94c --- /dev/null +++ b/cmake/profiles/linux_arm_gcc_11_debug @@ -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] diff --git a/cmake/profiles/linux_arm_gcc_11_release b/cmake/profiles/linux_arm_gcc_11_release new file mode 100644 index 000000000..2222f4639 --- /dev/null +++ b/cmake/profiles/linux_arm_gcc_11_release @@ -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] diff --git a/silkworm/silkrpc/commands/ots_api.cpp b/silkworm/silkrpc/commands/ots_api.cpp index 22e213e55..bdc696e48 100644 --- a/silkworm/silkrpc/commands/ots_api.cpp +++ b/silkworm/silkrpc/commands/ots_api.cpp @@ -34,6 +34,13 @@ #include #include +// 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};