micro-ROS / micro-ROS/micro-ROS-Agent

microxrcedds_agent.so fails to link in cross environment

未关闭
#258 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
201
派生
111
平均合并
1 天 6 小时
30 天内合并 PR
10

描述

Describe the bug
I tried using a cross compile workflow for Micro ROS Agent and it has linker errors.

To Reproduce
Steps to reproduce the behaviour:

  1. Clone repo on this branch and follow the dockerized instructions: https://github.com/Ryanf55/x-ros/tree/micro-ros-agent
  2. Compile the micro ros agent as explained
  3. Observe the following error:
# [  2%] Linking CXX shared library libmicroxrcedds_agent.so
# /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /opt/ros/humble/lib/libfastrtps.so.2.6.8: error adding symbols: file in wrong format

The linker is incorrectly trying to link to /opt/ros/humble/lib/libfastrtps.so.2.6.8. It should be linking to the shared library in the sysroot, not the host.

Expected behaviour
Successful compilation in a sysroot and linkage only to libraries in the sysroot.

System information (please complete the following information):

  • OS: Host OS Ubuntu 22
  • ROS 2 humble on host OS
  • Target OS: Ubuntu 22

Additional context

I have ROS 2 humble installed on the host OS. MicroROS should compile in the sysroot and ignore all host libraries.
Because it does not ignore host libraries, it is finding libraries of the wrong architecture.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 Docker 化的交叉编译说明以及生成 libmicroxrcedds_agent.so 的构建命令开始。检查为什么 /opt/ros/humble/lib/libfastrtps.so.2.6.8 出现在链接器输入中,而不是 sysroot 库中,然后为报告的目标架构重现构建过程。只有当 agent 仅使用 sysroot 中的库成功完成链接时,才算完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
build-system
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。