Skip to content

add NO_UNDEFINED_SYMBOLS to rclcpp_components_register_node cmake macro#2746

Merged
ahcorde merged 4 commits intoros2:jazzyfrom
ottojo:feat/components/no_undefined_symbols_flag
Mar 7, 2025
Merged

add NO_UNDEFINED_SYMBOLS to rclcpp_components_register_node cmake macro#2746
ahcorde merged 4 commits intoros2:jazzyfrom
ottojo:feat/components/no_undefined_symbols_flag

Conversation

@ottojo
Copy link
Copy Markdown
Contributor

@ottojo ottojo commented Feb 14, 2025

this adds an option NO_UNDEFINED_SYMBOLS to the rclcpp_components_register_node cmake 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_node is 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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants