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 摘要。