Snaipe / Mimick

A KISS, cross-platform C mocking library
MIT License
150 stars 42 forks source link

Architecture 'arm7-a' not supported when building for arm64-v8a #32

Open mpconte opened 1 year ago

mpconte commented 1 year ago

When trying to build mimick_vendor in ROS2, and installing the following ros dependencies:


# First part is generated with
# rosinstall_generator --format repos --upstream-devel --rosdistro humble --deps rclcpp sensor_msgs geometry_msgs --exclude rmw_fastrtps_cpp spdlog_vendor uncrustify_vendor rpyutils rosidl_generator_py fastrtps fastcdr rosidl_typesupport_fastrtps_c rosidl_typesupport_fastrtps_cpp rmw_fastrtps_dynamic_cpp performance_test_fixture iceoryx_binding_c google_benchmark_vendor rmw_connextdds rmw_connextdds_common rti_connext_dds_cmake_module rcl_logging_spdlog launch_testing_ament_cmake launch_testing launch iceoryx_posh ament_cmake_gmock ament_cmake_google_benchmark ament_cmake_gtest ament_cmake_pytest domain_coordinator ament_cmake_cpplint ament_cmake_flake8 ament_cmake_pep257 ament_cmake_uncrustify ament_cmake_xmllint ament_copyright ament_cppcheck ament_cpplint ament_flake8 ament_lint ament_lint_auto ament_lint_cmake ament_lint_common ament_pep257 gmock_vendor gtest_vendor iceoryx_hoofs
repositories:
  ament_cmake:
    type: git
    url: https://github.com/ament/ament_cmake.git
    version: humble
  ament_cmake_ros:
    type: git
    url: https://github.com/ros2/ament_cmake_ros.git
    version: humble
  ament_index:
    type: git
    url: https://github.com/ament/ament_index.git
    version: humble
  ament_lint:
    type: git
    url: https://github.com/ament/ament_lint.git
    version: humble
  ament_package:
    type: git
    url: https://github.com/ament/ament_package.git
    version: humble
  common_interfaces:
    type: git
    url: https://github.com/ros2/common_interfaces.git
    version: humble
  cyclonedds:
    type: git
    url: https://github.com/eclipse-cyclonedds/cyclonedds.git
    version: releases/0.9.x
  libstatistics_collector:
    type: git
    url: https://github.com/ros-tooling/libstatistics_collector.git
    version: humble
  libyaml_vendor:
    type: git
    url: https://github.com/ros2/libyaml_vendor.git
    version: humble
  mimick_vendor:
    type: git
    url: https://github.com/ros2/mimick_vendor.git
    version: humble
  osrf_testing_tools_cpp:
    type: git
    url: https://github.com/osrf/osrf_testing_tools_cpp.git
    version: master
  rcl:
    type: git
    url: https://github.com/ros2/rcl.git
    version: humble
  rcl_interfaces:
    type: git
    url: https://github.com/ros2/rcl_interfaces.git
    version: humble
  rcl_logging:
    type: git
    url: https://github.com/ros2/rcl_logging.git
    version: humble
  rclcpp:
    type: git
    url: https://github.com/ros2/rclcpp.git
    version: humble
  rcpputils:
    type: git
    url: https://github.com/ros2/rcpputils.git
    version: humble
  rcutils:
    type: git
    url: https://github.com/ros2/rcutils.git
    version: humble
  rmw:
    type: git
    url: https://github.com/ros2/rmw.git
    version: humble
  rmw_cyclonedds:
    type: git
    url: https://github.com/ros2/rmw_cyclonedds.git
    version: humble
  rmw_dds_common:
    type: git
    url: https://github.com/ros2/rmw_dds_common.git
    version: humble
  rmw_implementation:
    type: git
    url: https://github.com/ros2/rmw_implementation.git
    version: humble
  ros2_tracing:
    type: git
    url: https://github.com/ros2/ros2_tracing.git
    version: humble
  rosidl:
    type: git
    url: https://github.com/ros2/rosidl.git
    version: humble
  rosidl_defaults:
    type: git
    url: https://github.com/ros2/rosidl_defaults.git
    version: humble
  rosidl_typesupport:
    type: git
    url: https://github.com/ros2/rosidl_typesupport.git
    version: humble
  test_interface_files:
    type: git
    url: https://github.com/ros2/test_interface_files.git
    version: humble
  unique_identifier_msgs:
    type: git
    url: https://github.com/ros2/unique_identifier_msgs.git
    version: humble
# Hand made
  rcl_logging_android:
    type: git
    url: https://github.com/sloretz/rcl_logging_android.git
    version: main

and running the colcon command to build these packages as follows:

colcon build --cmake-args -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=30 -DCMAKE_ANDROID_N
DK=/mnt/d/android-ndk-r25b -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=/mnt/d/android-ndk-r25b -DANDROID_ABI=x86_64 -DANDROID_NATIVE_API_LEVEL=30 -DCMAKE_TOOLCHAIN_FILE=/mnt/d/android-ndk-r25b/build/cmake/android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH="/mnt/d/ros2-humble/install/ament_cmake_core/share/ament_cmake_core;/mnt/d/ros2-humble/install/ament_cmake_python/share/ament_cmake_python/cmake;/mnt/d/ros2-humble/install/osrf_testing_tools_cpp/share/osrf_testing_tools_cpp/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_dependencies/share/ament_cmake_export_dependencies/cmake;/mnt/d/ros2-humble/install/ament_cmake_test/share/ament_cmake_test/cmake;/mnt/d/ros2-humble/install/ament_cmake_lint_cmake/share/ament_cmake_lint_cmake/cmake;/mnt/d/ros2-humble/install/ament_cmake_gtest/share/ament_cmake_gtest/cmake;/mnt/d/ros2-humble/install/ament_cmake_copyright/share/ament_cmake_copyright/cmake;/mnt/d/ros2-humble/install/ament_cmake/share/ament_cmake/cmake;/mnt/d/ros2-humble/install/ament_cmake_libraries/share/ament_cmake_libraries/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_definitions/share/ament_cmake_export_definitions/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_include_directories/share/ament_cmake_export_include_directories/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_interfaces/share/ament_cmake_export_interfaces/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_libraries/share/ament_cmake_export_libraries/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_link_flags/share/ament_cmake_export_link_flags/cmake;/mnt/d/ros2-humble/install/ament_cmake_export_targets/share/ament_cmake_export_targets/cmake;/mnt/d/ros2-humble/install/ament_cmake_gen_version_h/share/ament_cmake_gen_version_h/cmake;/mnt/d/ros2-humble/install/ament_cmake_target_dependencies/share/ament_cmake_target_dependencies/cmake;/mnt/d/ros2-humble/install/ament_cmake_include_directories/share/ament_cmake_include_directories/cmake;/mnt/d/ros2-humble/install/ament_cmake_version/share/ament_cmake_version/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_core/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_python/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_test/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_dependencies/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_gtest/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_lint_cmake/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_copyright/cmake;/mnt/d/ros2-humble/install/share/ament_cmake/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_libraries/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_definitions/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_include_directories/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_interfaces/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_libraries/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_link_flags/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_export_targets/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_gen_version_h/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_target_dependencies/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_include_directories/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_version/cmake;/mnt/d/ros2-humble/install/share/ament_lint_auto/cmake;/mnt/d/ros2-humble/install/share/ament_cmake_pytest/cmake" --merge-install

I receive the following error when building mimick_vendor:


--- stderr: mimick_vendor
CMake Error at CMakeLists.txt:88 (message):
  Architecture 'armv7-a' is not supported.

make[2]: *** [CMakeFiles/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7.dir/build.make:92: mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-stamp/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
---
Failed   <<< mimick_vendor [39.0s, exited with code 2]
Snaipe commented 1 year ago

Can you check whether the following trampoline would work with arm7-a? https://github.com/Snaipe/Mimick/blob/master/src/asm/trampoline-arm.S

You can edit by hand this line https://github.com/Snaipe/Mimick/blob/master/CMakeLists.txt#L17 to allow the architecture to be correctly detected.

mpconte commented 1 year ago

Hi @Snaipe, so I tried to build Mimick via ros2 mimick in the humble branch which attempts to build the v0.2.0 branch for Mimick, and it seems to have gotten past the architecture check, but I get the following issue:

Platform 'Android' is not supported.

Is this currently the case for any release of Mimick?

Snaipe commented 1 year ago

Probably. You would need to add the necessary platform detection bits but I'm expecting it to be pretty much the same as Linux. If it gets past the tests, we could just add the detection back here.