Skip to content

cc_defs: Add -rdynamic to linkopts for clang compiler by default#631

Open
furushchev wants to merge 1 commit into
mvukov:mainfrom
furushchev:llvm-linkopts
Open

cc_defs: Add -rdynamic to linkopts for clang compiler by default#631
furushchev wants to merge 1 commit into
mvukov:mainfrom
furushchev:llvm-linkopts

Conversation

@furushchev

Copy link
Copy Markdown

Closes #630

This change adds default linker option -rdynamic to C++ binaries built with ros2_cpp_binary.
It's enabled only with LLVM toolchain (e.g. https://github.com/hermeticbuild/hermetic-llvm )

@mvukov

mvukov commented May 17, 2026

Copy link
Copy Markdown
Owner

Can we do this in a similar way as for clang? See https://github.com/mvukov/rules_ros2/blob/main/.bazelrc#L51-L53 -- we could have another llvm config there.

@furushchev

Copy link
Copy Markdown
Author

Can we do this in a similar way as for clang? See https://github.com/mvukov/rules_ros2/blob/main/.bazelrc#L51-L53 -- we could have another llvm config there.

Hmm, this parameter is only necessary for binaries that link to the pluginlib library, so there's no need to set it globally. Therefore, I think it would be better to configure it in the current PR rather than writing it in .bazelrc.

@mvukov

mvukov commented May 25, 2026

Copy link
Copy Markdown
Owner

This is llvm specific, so, I'd prefer to have this in an llvm config.

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.

Pluginlib does not load plugins when compiled with LLVM toolchain

2 participants