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

Cross compilation support & linking #288

Open
tervay-bdai opened this issue Jul 11, 2023 · 1 comment
Open

Cross compilation support & linking #288

tervay-bdai opened this issue Jul 11, 2023 · 1 comment

Comments

@tervay-bdai
Copy link

Hi, thanks all for the great work on this. Attempting to get ROS2 to cross-compile to ARM64 with Drake's ROS bazel rules and grailbio's toolchain rules. I'm pointing it to a sysroot that has ROS ARM64 .so files.

Unfortunately, attempting to build a simple hello world tries to link x86 .so libraries despite it trying to compile for ARM64:

 "external/llvm_toolchain_llvm/bin/ld.lld" --sysroot=external/arm64_debian_rootfs -EL -z relro --hash-style=gnu --eh-frame-hdr -m aarch64linux -dynamic-linker /lib/ld-linux-aarch64.so.1 -o bazel-out/k8-opt-pi/bin/src/hello_world_cpp_ros2/_hello_world_noshim external/arm64_debian_rootfs/lib/aarch64-linux-gnu/crt1.o external/arm64_debian_rootfs/lib/aarch64-linux-gnu/crti.o external/arm64_debian_rootfs/lib/gcc/aarch64-linux-gnu/11/crtbegin.o -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crclcpp_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcl_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcl_Ulogging_Uspdlog_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcl_Ulogging_Uinterface_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crmw_Uimplementation_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cament_Uindex_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcl_Uinterfaces_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcl_Uyaml_Uparam_Uparser_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibyaml_Uvendor_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cyaml_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosgraph_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstatistics_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cbuiltin_Uinterfaces_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Udefault_Uruntime_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Ugenerator_Upy_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcpputils_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ufastrtps_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ufastrtps_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cfastcdr_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crmw_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uintrospection_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Uruntime_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uintrospection_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crosidl_Uruntime_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crcutils_Ucc___U_Uopt_Uros_Uhumble_Slib -Lbazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Ctracetools_Ucc___U_Uopt_Uros_Uhumble_Slib -Lexternal/arm64_debian_rootfs/opt/ros/humble/lib -Lexternal/arm64_debian_rootfs/lib/gcc/aarch64-linux-gnu/11 -Lexternal/arm64_debian_rootfs/lib/aarch64-linux-gnu -Lexternal/arm64_debian_rootfs/usr/lib/aarch64-linux-gnu -Lexternal/arm64_debian_rootfs/lib -Lexternal/arm64_debian_rootfs/usr/lib -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crclcpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crclcpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcl_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcl_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcl_Ulogging_Uspdlog_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcl_Ulogging_Uspdlog_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcl_Ulogging_Uinterface_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcl_Ulogging_Uinterface_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crmw_Uimplementation_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crmw_Uimplementation_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Cament_Uindex_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Cament_Uindex_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcl_Uinterfaces_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcl_Uinterfaces_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcl_Uyaml_Uparam_Uparser_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcl_Uyaml_Uparam_Uparser_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Clibyaml_Uvendor_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Clibyaml_Uvendor_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Cyaml_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Cyaml_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosgraph_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosgraph_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Cstatistics_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Cstatistics_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Cbuiltin_Uinterfaces_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Cbuiltin_Uinterfaces_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Udefault_Uruntime_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Udefault_Uruntime_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Ugenerator_Upy_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Ugenerator_Upy_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcpputils_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcpputils_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ufastrtps_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ufastrtps_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ufastrtps_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Ufastrtps_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Cfastcdr_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Cfastcdr_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crmw_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crmw_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uintrospection_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uintrospection_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Uruntime_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Uruntime_Ucpp_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uintrospection_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Utypesupport_Uintrospection_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crosidl_Uruntime_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crosidl_Uruntime_Uc_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Crcutils_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Crcutils_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/../../_solib_aarch64/_U@ros2_S_S_Ctracetools_Ucc___U_Uopt_Uros_Uhumble_Slib" -rpath "\$ORIGIN/_hello_world_noshim.runfiles/_main/_solib_aarch64/_U@ros2_S_S_Ctracetools_Ucc___U_Uopt_Uros_Uhumble_Slib" -lm --build-id=md5 --hash-style=gnu -z relro -z now -l:libstdc++.a --gc-sections bazel-out/k8-opt-pi/bin/src/hello_world_cpp_ros2/_objs/_hello_world_noshim/hello_world.o -lrclcpp -llibstatistics_collector -lrcl_yaml_param_parser -lrmw_implementation -lrcl_logging_spdlog -ltracetools -lrcl_interfaces__rosidl_typesupport_c -lrcl_interfaces__rosidl_generator_c -lrcl_logging_interface -lrcl_interfaces__rosidl_typesupport_fastrtps_c -lrcl_interfaces__rosidl_typesupport_introspection_c -lrcl_interfaces__rosidl_typesupport_fastrtps_cpp -lrcl_interfaces__rosidl_typesupport_introspection_cpp -lrcl_interfaces__rosidl_typesupport_cpp -lrcl_interfaces__rosidl_generator_py -lstd_msgs__rosidl_typesupport_fastrtps_c -lstd_msgs__rosidl_generator_c -lstd_msgs__rosidl_typesupport_fastrtps_cpp -lstd_msgs__rosidl_typesupport_introspection_c -lstd_msgs__rosidl_typesupport_introspection_cpp -lstd_msgs__rosidl_typesupport_cpp -lstd_msgs__rosidl_generator_py -lstd_msgs__rosidl_typesupport_c -lrcl -lyaml -lament_index_cpp -lrcpputils -lrosidl_typesupport_c -lbuiltin_interfaces__rosidl_generator_c -lbuiltin_interfaces__rosidl_typesupport_fastrtps_c -l:libfastcdr.so.1 -lrosidl_typesupport_fastrtps_c -lbuiltin_interfaces__rosidl_typesupport_introspection_c -lrosidl_typesupport_introspection_c -lbuiltin_interfaces__rosidl_typesupport_fastrtps_cpp -lrosidl_typesupport_fastrtps_cpp -l:libfastcdr.so.1.0.24 -lbuiltin_interfaces__rosidl_typesupport_introspection_cpp -lrosidl_typesupport_introspection_cpp -lrosidl_typesupport_cpp -lbuiltin_interfaces__rosidl_typesupport_cpp -lbuiltin_interfaces__rosidl_generator_py -lbuiltin_interfaces__rosidl_typesupport_c -lrcl_logging_spdlog -lrcl_logging_interface -lrmw_implementation -lrmw -lrosidl_runtime_c -lament_index_cpp -lrcl_interfaces__rosidl_typesupport_fastrtps_c -lrcl_interfaces__rosidl_generator_c -lrcl_interfaces__rosidl_typesupport_introspection_c -lrcl_interfaces__rosidl_typesupport_fastrtps_cpp -lrcl_interfaces__rosidl_typesupport_introspection_cpp -lrcl_interfaces__rosidl_typesupport_cpp -lrcl_interfaces__rosidl_generator_py -lrcl_interfaces__rosidl_typesupport_c -lrcl_yaml_param_parser -lrcutils -lrosidl_runtime_c -lyaml -lyaml -lrosgraph_msgs__rosidl_typesupport_fastrtps_c -lrosgraph_msgs__rosidl_typesupport_fastrtps_cpp -lrosgraph_msgs__rosidl_typesupport_introspection_c -lrosgraph_msgs__rosidl_generator_c -lrosgraph_msgs__rosidl_typesupport_introspection_cpp -lrosgraph_msgs__rosidl_typesupport_cpp -lrosgraph_msgs__rosidl_generator_py -lrosgraph_msgs__rosidl_typesupport_c -lstatistics_msgs__rosidl_typesupport_fastrtps_c -lstatistics_msgs__rosidl_generator_c -lstatistics_msgs__rosidl_typesupport_fastrtps_cpp -lstatistics_msgs__rosidl_typesupport_introspection_c -lstatistics_msgs__rosidl_typesupport_introspection_cpp -lstatistics_msgs__rosidl_typesupport_cpp -lstatistics_msgs__rosidl_generator_py -lstatistics_msgs__rosidl_typesupport_c -lbuiltin_interfaces__rosidl_typesupport_fastrtps_c -lrosidl_typesupport_fastrtps_c -l:libfastcdr.so.1 -lrosidl_runtime_c -lrcutils -lbuiltin_interfaces__rosidl_typesupport_introspection_c -lbuiltin_interfaces__rosidl_generator_c -lrosidl_typesupport_introspection_c -lbuiltin_interfaces__rosidl_typesupport_fastrtps_cpp -lrosidl_typesupport_fastrtps_cpp -lbuiltin_interfaces__rosidl_typesupport_introspection_cpp -lrosidl_typesupport_introspection_cpp -lbuiltin_interfaces__rosidl_typesupport_cpp -lrosidl_typesupport_cpp -lbuiltin_interfaces__rosidl_generator_py -l:libfastcdr.so.1.0.24 -lrmw -lbuiltin_interfaces__rosidl_typesupport_c -lrosidl_typesupport_c -lrcpputils -lrcutils -lrosidl_typesupport_cpp -lrosidl_typesupport_c -lrcpputils -lrosidl_typesupport_fastrtps_c -lrosidl_typesupport_fastrtps_cpp -l:libfastcdr.so.1.0.24 -l:libfastcdr.so.1.0.24 -lrmw -lrosidl_typesupport_introspection_cpp -lrcutils -lrosidl_typesupport_introspection_c -lrosidl_runtime_c -lrcutils -ltracetools -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed external/arm64_debian_rootfs/lib/gcc/aarch64-linux-gnu/11/crtend.o external/arm64_debian_rootfs/lib/aarch64-linux-gnu/crtn.o
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Crclcpp_Ucc___U_Uopt_Uros_Uhumble_Slib/librclcpp.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/liblibstatistics_collector.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_yaml_param_parser.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librmw_implementation.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_logging_spdlog.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/libtracetools.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_typesupport_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_generator_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_logging_interface.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_typesupport_fastrtps_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_typesupport_introspection_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_typesupport_fastrtps_cpp.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_typesupport_introspection_cpp.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_typesupport_cpp.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Clibstatistics_Ucollector_Ucc___U_Uopt_Uros_Uhumble_Slib/librcl_interfaces__rosidl_generator_py.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib/libstd_msgs__rosidl_typesupport_fastrtps_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib/libstd_msgs__rosidl_generator_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib/libstd_msgs__rosidl_typesupport_fastrtps_cpp.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib/libstd_msgs__rosidl_typesupport_introspection_c.so is incompatible with elf64-littleaarch64
ld.lld: error: bazel-out/k8-opt-pi/bin/_solib_aarch64/_U@ros2_S_S_Cstd_Umsgs_Ucc___U_Uopt_Uros_Uhumble_Slib/libstd_msgs__rosidl_typesupport_introspection_cpp.so is incompatible with elf64-littleaarch64
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

(where arm64_debian_rootfs is my target arm64 sysroot.) You can see it's including -Lexternal/arm64_debian_rootfs/opt/ros/humble/lib in the linker options - which I configured via linkopts in ros_cc_binary - but it still seems to be trying to link x86 .sos.

Is there a way to configure the bazel rules to allow cross-compilation with ROS2? Maybe via specifying CMake variables outlined here? Configuring multiple ros2_repositorys in WORKSPACE?

@lgulich
Copy link

lgulich commented Nov 3, 2023

Hey @tervay-bdai
Did you ever find a solution? I also have a bazel-ros workspace that I have to cross-compile for ARM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants