Cross Compilation of ROS2 fails with gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf toolchain

asked 2018-09-26 10:30:33 -0500

charles.haynes gravatar image

updated 2018-09-26 15:23:15 -0500

gvdhoorn gravatar image

I have followed the directions ros2 on arm architecture and everything builds successfully. So I change the Path to my desired toolchain and set CROSS_COMPILATION=arm-linux-gnueabihf- and it fails on

Starting >>> examples_rclcpp_minimal_publisher
--- stderr: examples_rclcpp_minimal_client                                                                                                                                               
CMake Warning at ros2_arm_ws/install/rmw_implementation/share/rmw_implementation/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
  Package 'rmw_implementation' exports library 'pthread' which couldn't be
  found

/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: warning: libfastcdr.so.1.0.7, needed by /ros2_arm_ws/install/rcl_interfaces/lib/librcl_interfaces__rosidl_typesupport_fastrtps_c.so, not found (try using -rpath or -rpath-link)s/ros2_arm_ws/install/rcl_interfaces/lib/librcl_interfaces__rosidl_typesupport_fastrtps_c.so: undefined reference to `eprosima::fastcdr::Cdr::deserialize(char&)'
/ros2_arm_ws/install/rcl_interfaces/lib/librcl_interfaces__rosidl_typesupport_fastrtps_cpp.so: undefined reference to `eprosima::fastcdr::Cdr::serializeBoolSequence(std::vector<bool, std::allocator<bool> > const&)'

I eventually got it to work, but I did have a lot of warnings

/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: /home/colas/ros2_arm_ws/install/lib/libnav_msgs__rosidl_typesupport_c.so: invalid string offset 3675 >= 3578 for section `.strtab'
/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: /home/colas/ros2_arm_ws/install/lib/libnav_msgs__rosidl_typesupport_c.so: invalid string offset 3663 >= 3578 for section `.strtab'
/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: /home/colas/ros2_arm_ws/install/lib/libnav_msgs__rosidl_typesupport_c.so: invalid string offset 3664 >= 3578 for section `.strtab'
/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: /home/colas/ros2_arm_ws/install/lib/libnav_msgs__rosidl_typesupport_c.so: invalid string offset 3649 >= 3578 for section `.strtab'
/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: /home/colas/ros2_arm_ws/install/lib/libnav_msgs__rosidl_typesupport_c.so: invalid string offset 3683 >= 3578 for section `.strtab'
/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: /home/colas/ros2_arm_ws/install/lib/libnav_msgs__rosidl_typesupport_c.so: invalid string offset 3637 >= 3578 for section `.strtab'


Finished <<< map_msgs [31.9s]

Summary: 129 packages finished [7min 32s]
  99 packages had stderr output: actionlib_msgs ament_cmake ament_cmake_auto ament_cmake_clang_format ament_cmake_copyright ament_cmake_core ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_export_definitions ament_cmake_export_dependencies ament_cmake_export_include_directories ament_cmake_export_interfaces ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_flake8 ament_cmake_gmock ament_cmake_gtest ament_cmake_include_directories ament_cmake_libraries ament_cmake_lint_cmake ament_cmake_nose ament_cmake_pclint ament_cmake_pep257 ament_cmake_pep8 ament_cmake_pyflakes ament_cmake_pytest ament_cmake_python ament_cmake_ros ament_cmake_target_dependencies ament_cmake_test ament_cmake_uncrustify ament_index_cpp ament_lint_auto ament_lint_common builtin_interfaces class_loader common_interfaces console_bridge diagnostic_msgs example_interfaces examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer fastcdr fastrtps fastrtps_cmake_module geometry_msgs gmock_vendor gtest_vendor libyaml_vendor lifecycle_msgs map_msgs nav_msgs osrf_testing_tools_cpp pluginlib poco_vendor rcl rcl_interfaces rcl_lifecycle rcl_yaml_param_parser rclcpp rclcpp_lifecycle rcutils rmw rmw_fastrtps_cpp rmw_implementation rmw_implementation_cmake ros_environment rosgraph_msgs rosidl_cmake rosidl_default_generators rosidl_default_runtime rosidl_generator_c rosidl_generator_cpp rosidl_generator_dds_idl rosidl_parser rosidl_typesupport_c rosidl_typesupport_cpp rosidl_typesupport_interface rosidl_typesupport_introspection_c rosidl_typesupport_introspection_cpp rttest sensor_msgs shape_msgs std_msgs std_srvs stereo_msgs test_osrf_testing_tools_cpp tinyxml2_vendor tinyxml_vendor tlsf tlsf_cpp trajectory_msgs uncrustify_vendor urdfdom_headers visualization_msgs
edit retag flag offensive close merge delete

Comments

Can you give the steps you did to make it work with this new toolchain and accept your answer if your problem is solved ? Was it because it was too old ? Did you added new flags ? It seems you are using a 32 bit toolchain and the tutorial suggest a 64 but one .

pokitoz gravatar imagepokitoz ( 2018-09-29 11:08:04 -0500 )edit