You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android cross compilation with latest platform API results in a compile error in the signal_handler of rclcpp.
Actual behavior
Starting >>> rclcpp
--- stderr: rclcpp
/home/EU/dekoehlr/work/ros2_core_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/signal_handler.cpp:176:7:
error: cannot initialize a variable of type 'int' with an rvalue of type 'char *'
int error_status = strerror_r(errnum, buffer, buffer_length);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/rclcpp.dir/src/rclcpp/signal_handler.cpp.o] Error 1
make[1]: *** [CMakeFiles/rclcpp.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< rclcpp [ Exited with code 2 ]
Additional information
The cause is the use of the reentrant strerror_r reporting function, which has a inconsistent function signature in the XSI and GNU string.h core library.
The feature test macros (see https://linux.die.net/man/3/strerror_r) to distinguish between XSI and POSIX are not reliable on Android as the _GNU_SOURCE may or may not be defined depending on the API level. For a discussion of the use of strerror_r see http://austingroupbugs.net/view.php?id=655.
Possible solutions are substituting the ambiguous strerror_r by the (re-entrant) strerror_l, or use the prototype definition check provided by cmake, e.g.:
Please consider to provide a pull request to address this since you have the platform at hand to verify that the potential patch will resolve the problem.
@roderick-koehle with #742 merged I am going to close this issue. If there are other issues with cross-compilation we can re-open this one or you can submit a new one as appropriate.
Bug report
Steps to reproduce issue
Android cross compilation with latest platform API results in a compile error in the signal_handler of rclcpp.
Actual behavior
Additional information
The cause is the use of the reentrant
strerror_r
reporting function, which has a inconsistent function signature in the XSI and GNU string.h core library.The feature test macros (see https://linux.die.net/man/3/strerror_r) to distinguish between XSI and POSIX are not reliable on Android as the _GNU_SOURCE may or may not be defined depending on the API level. For a discussion of the use of
strerror_r
see http://austingroupbugs.net/view.php?id=655.Possible solutions are substituting the ambiguous
strerror_r
by the (re-entrant)strerror_l
, or use the prototype definition check provided by cmake, e.g.:The text was updated successfully, but these errors were encountered: