add NO_UNDEFINED_SYMBOLS to rclcpp_components_register_node cmake macro#2746
Conversation
Signed-off-by: Jonas Otto <jonas.otto@ipa.fraunhofer.de>
f4688b4 to
d44b54d
Compare
|
I wonder if we should also use |
Reading an article on this in the gentoo wiki, it seems this would be useful here, as long as there are no symbols that would only be provided by the container which loads the component. I did a quick test, and it seems that this is not the case, but i'm not very familiar with the plugin mechanism under the hood. |
Signed-off-by: Jonas Otto <jonas.otto@ipa.fraunhofer.de>
4ff2c58 to
38656ac
Compare
Signed-off-by: Jonas Otto <jonas@jonasotto.com>
sloretz
left a comment
There was a problem hiding this comment.
I'm not sure whether --no-allow-shlib-undefined should be included because I can't find docs for it, but approving because the code LGTM!
the |
|
Pulls: #2746 |
…ndefined_symbols_flag
|
Pulls: #2746 |
|
Windows warnings are unrelated |
|
Should this be |
|
@Mergifyio backport rolling |
✅ Backports have been createdDetails
|
…ro (ros2#2746) Signed-off-by: Jonas Otto <jonas.otto@ipa.fraunhofer.de> Signed-off-by: Jonas Otto <jonas@jonasotto.com>
…ro (ros2#2746) Signed-off-by: Jonas Otto <jonas.otto@ipa.fraunhofer.de> Signed-off-by: Jonas Otto <jonas@jonasotto.com>
this adds an option
NO_UNDEFINED_SYMBOLSto therclcpp_components_register_nodecmake macro, which adds the required linker option to the (component library) target to deny undefined symbols.Undefined symbols usually produce an error if an executable is built, but due to the way the autogenerated executable generated by
rclcpp_components_register_nodeis constructed, that doesn't happen here, and the error occurs only when executing it.This change makes this a link-time error again.
This is especially intended for the workflow of migrating a ros node which was built directly as an executable before to using
rclcpp_components_register_node.By default, the option is disabled. If no adverse impact is detected, i suggest enabling it by default in a future release.
fixes #2744