apache / celix

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
https://celix.apache.org/
Apache License 2.0
158 stars 85 forks source link

Export less when using Embedded Bundles #675

Closed PengZheng closed 5 months ago

PengZheng commented 8 months ago

Currently, to support embedded bundles, we use linker flag --export-dynamic to make the added symbols visible to dlopen. This flag will export all symbols, and thus will make gc-sections useless.

Considering the use case of embedded Celix into a large legacy application (1), which relies gc-sections to reduce its binary footprint, I suggest exporting less by using --export-dynamic-symbol for Linux.

[1] https://lists.apache.org/thread/tdl6zt8dh34ynh8cz32rxs8o957ljlzt

pnoltes commented 8 months ago

Do we still need embedded bundles?

I added this with the idea that you could create a executable with only embedded bundles and install and use that without needed to figure out how to install bundles and use bundles on a target platform. But it does create additional complexity (mainly --export-dynamic-symbol and assembly code) and I am not sure anymore if this is worth it.

Because we are now working on a major update, it is also possible to drop embedded bundles support.

PengZheng commented 8 months ago

Do we still need embedded bundles?

Currently I have no usage of embedded bundles, and thus I am not against removing it.

pnoltes commented 8 months ago

Do we still need embedded bundles?

Currently I have no usage of embedded bundles, and thus I am not against removing it.

I will remove the support for embedded bundles. In hindsight I think it is better to focus on a better bundle caching/storage system.

PengZheng commented 5 months ago

This has been addressed by #707.