Skip to content

add NO_UNDEFINED_SYMBOLS to rclcpp_components_register_node cmake macro (backport #2746)#2764

Merged
ahcorde merged 1 commit intorollingfrom
mergify/bp/rolling/pr-2746
Mar 11, 2025
Merged

add NO_UNDEFINED_SYMBOLS to rclcpp_components_register_node cmake macro (backport #2746)#2764
ahcorde merged 1 commit intorollingfrom
mergify/bp/rolling/pr-2746

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Mar 11, 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


This is an automatic backport of pull request #2746 done by Mergify.

…ro (#2746)

Signed-off-by: Jonas Otto <jonas.otto@ipa.fraunhofer.de>
Signed-off-by: Jonas Otto <jonas@jonasotto.com>
(cherry picked from commit c31daa6)
@fujitatomoya
Copy link
Copy Markdown
Collaborator

@ottojo can you review this just in case?

@fujitatomoya fujitatomoya self-assigned this Mar 11, 2025
@fujitatomoya
Copy link
Copy Markdown
Collaborator

Pulls: #2764
Gist: https://gist.githubusercontent.com/fujitatomoya/a0e480def1d016046617ee761d354e62/raw/ddf29da8c65c79029f2253456d1afe4b9497d892/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp_components
TEST args: --packages-above rclcpp_components
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15328

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Mar 11, 2025

Windows CI error is unrelated

@ahcorde ahcorde merged commit 387bf7b into rolling Mar 11, 2025
3 checks passed
@ahcorde ahcorde deleted the mergify/bp/rolling/pr-2746 branch March 11, 2025 15:35
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.

rclcpp_components_register_node macro: --no-undefined linker option

3 participants