-
Notifications
You must be signed in to change notification settings - Fork 47
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
Issue with cross compiling rnw_cyclonedds towards aarch64 #144
Comments
Well, PIC is explicitly enabled in https://github.com/mvukov/rules_ros2/blob/main/repositories/cyclonedds.BUILD.bazel#L74. Should be investigated which flags cmake actually uses -- e.g. in The reason I went for rules_foreign_cc from native Bazel targets is somewhat easier maintenance -- this happened once we added iceoryx support. This is not set in stone and we might revert that. |
You can also investigate which C/C++ flags gcc-toolchain uses -- this might not be in line with the stock cc toolchain. |
This sounds like a problem I would enjoy investigating! 😉 Maybe I'll find some time in the next couple of days... But no promises! |
The issue seems to be the Not sure how to fix this. Could be a gcc bug. Adding a patch for CycloneDDS, so |
This seems to be related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85801 |
I cloned https://github.com/eclipse-cyclonedds/cyclonedds/tree/0.9.1 and ran ./ports/solaris2.6/config.mk:50: # OPT = -O3 -DNDEBUG -flto
./src/core/CMakeLists.txt:36: #-flto and debugging info do not seem to go well together Doesn't seem like |
The You can run |
Looking to cross-compile for aarch64 soon... what is the preferred workaround? Are there any repercussions with "patching |
This is a possibility, but AFAIR that doesn't include support for iceoryx (shared memory backend). Would be nice to eventually work out / update true Bazel build for cyclonedds that also conditionally supports iceoryx (which can be built by bazel). BTW @mikebauer, I saw that you made this patch: https://github.com/resim-ai/open-core/blob/main/resim/third_party/ros2/flto.patch. Was that maybe related to cross-compilation? In the end, I think I'll add faq/troubleshooting section to the readme as @ahans suggested and probably add&reference the cyclonedds patch from #151. I agree with @ahans that this issue is remotely related to this repo. |
Thanks! |
Hi, I am using gcc_toolchain to cross compile ros2 nodes towards aarch64 using this repo. I am having an issue with
@ros2_rmw_cyclonedds//:rmw_cyclonedds
.How to reproduce:
BAZEL_VERSION=6.2.1
rules_ros2: 89dd5fa0add476e85a438c8575f353ecf6162c57
WORKSPACE
.bazelrc
Build command:
Actual result:
Expected result:
Workaround:
Tried following the error message and adding
-fPIC
tocopts
andCMAKE_C_FLAGS
, which did not work.Patching
repositories/cyclonedds.BUILD.bazel
back to commitc4a1c00a06692b8553a29e2bc6b869dc611eef45
causes the shared library to compile correctly.The text was updated successfully, but these errors were encountered: