-
Notifications
You must be signed in to change notification settings - Fork 247
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
mavros: "undefined reference to `__atomic_{load,store}_8'" while linking on qemuarm, qemumips, qemuppc #525
Comments
@TSC21 Would you have time to look into this issue? Possibly you already resolved this issue upstream and we must just apply a patch from the upstream repository? |
@bulwahn it's the first time I'm seeing this problem. Most probable is a GCC compatibility issue. I will recheck the current recipe but I believe that the more we upgrade MAVROS and don't keep up with the ROS version, more problems will come. |
I did some research and found out that: Some discussions that point out the issue are:
More discussions on this error can be found by googling for I have a patch that resolves the issue and will provide that upstream at the mavros repository soon, discuss it, and then finally also provide a pull request here in meta-ros. |
For arm & mips architecture, the linker must explicitly be asked to link the atomic library (with `-latomic`). Otherwise, the linking fails with: ``` | devel/lib/libmavros.so: undefined reference to `__atomic_load_8' | devel/lib/libmavros.so: undefined reference to `__atomic_store_8' | collect2: error: ld returned 1 exit status ``` Linking `atomic` unconditionally as library is strictly needed only for arm & mips, but it seems not to imply any further differences with other architectures. Hence, this commit simply adds `atomic` unconditionally for a uniform handling of all machine architectures. This is an alternative solution to the proposed solution in mavlink#790. The issue was discovered cross-compiling mavros in meta-ros, the OpenEmbedded layer for ROS. Some further pointers are available at: ros/meta-ros#525 Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
For arm & mips architecture, the linker must explicitly be asked to link the atomic library (with `-latomic`). Otherwise, the linking fails with: ``` | devel/lib/libmavros.so: undefined reference to `__atomic_load_8' | devel/lib/libmavros.so: undefined reference to `__atomic_store_8' | collect2: error: ld returned 1 exit status ``` Linking `atomic` unconditionally as library is strictly needed only for arm & mips, but it seems not to imply any further differences with other architectures. Hence, this commit simply adds `atomic` unconditionally for a uniform handling of all machine architectures. This is an alternative solution to the proposed solution in #790. The issue was discovered cross-compiling mavros in meta-ros, the OpenEmbedded layer for ROS. Some further pointers are available at: ros/meta-ros#525 Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
On the current openembedded-core master with qemuarm and on poky pyro with qemuarm, qemumips and qemuppc, the mavros recipe fails with:
I did not test yet on the current openembedded-core master with other machine than qemuarm; it probably also occurs with qemumips and qemuppc, as this failed on the poky pyro release with those machines.
These are the build configurations where
mavros
was failing:The text was updated successfully, but these errors were encountered: