Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is [no_mangle] required for plugins? #751

Open
milyin opened this issue Feb 22, 2024 · 3 comments
Open

Is [no_mangle] required for plugins? #751

milyin opened this issue Feb 22, 2024 · 3 comments
Labels
question Further information is requested

Comments

@milyin
Copy link
Contributor

milyin commented Feb 22, 2024

Describe the bug

In the plugins the #[cfg(feature = "no_mangle")] before zenoh_plugin_trait::declare_plugin!(... is used to avoid export of unmangled get_plugin_loader_version, get_compatibility, and load_plugin functions when they are not needed, i.e. when plugin is linked as static. Though it seems that everything works without them.

eclipse-zenoh/zenoh-plugin-mqtt#32 (comment)

Need to understand is this no_mangle feature really necessary

To reproduce

System info

@gabrik
Copy link
Contributor

gabrik commented Feb 22, 2024

I had symbol clashes in the past when statically linking more plugins, to be checked if it is still the case.

@p-avital
Copy link
Contributor

I had symbol clashes in the past when statically linking more plugins, to be checked if it is still the case.

This is why the feature exists: when statically linking more than one plugin, the linker will fail because multiple definitions for the same symbols exist.

@milyin
Copy link
Contributor Author

milyin commented Feb 22, 2024

I had symbol clashes in the past when statically linking more plugins, to be checked if it is still the case.

This is why the feature exists: when statically linking more than one plugin, the linker will fail because multiple definitions for the same symbols exist.

And that's the question now: how to reproduce this name clash again to justify usage of "no_mangle" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants