Skip to content

rclcpp_components_register_node macro: --no-undefined linker option #2744

@ottojo

Description

@ottojo

Hi! When converting nodes to components i found myself running into linker issues of undefined symbols at runtime, which would otherwise occur at compile/link time.

I suggest adding

target_link_options(${target} PRIVATE "-Wl,--no-undefined")

to the rclcpp_components_register_node macro, to ensure there are no undefined symbols when the generated executable is run or the component is loaded into a container later.

I'm unsure of the consequences, or if there are valid use cases for having undefined references in the component library, which is why i want to open this for discussion here first before making a PR. Please let me know if you know of any.
I think users of rclcpp_components_register_node would expect to be able to use the generated executable, which would require this anyways.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions