PengZheng commented on issue #571: URL: https://github.com/apache/celix/issues/571#issuecomment-1585632983
> See snippet: I understand why we need `$ORIGIN` set for private library. But I don't quite understand we need it at build time: Conan test_package can help ensure `$ORIGIN` in the installed binary works as expected. BUILD_RPATH is just a convenience feature. See https://github.com/apache/celix/commit/eccbb7f9be7958b5724e8569164e8c14052abcae and https://github.com/apache/celix/pull/569/commits/514a71e8fc55501976f2867bc5359d9635d484d2 for examples. > a) Link against the required bundle dependency libraries so that during bundle loading the needed libraries can be found `target_link_libraries(rsa_json_rpc PRIVATE ${RSA_JSON_RPC_DEPS})` has already done this for `Celix::dfi`, if we have the default `BUILD_RPATH` in place. `rsa_json_rpc` does not really need a private copy of `Celix::dfi`. IMHO, `BUILD_RPATH` is just a convenience feature. Will these commits (https://github.com/apache/celix/commit/eccbb7f9be7958b5724e8569164e8c14052abcae and https://github.com/apache/celix/pull/569/commits/514a71e8fc55501976f2867bc5359d9635d484d2) bring about any harm? > b) Add required bundle dependency libraries as a private lib / file to the bundle using the libraries As documented in `celix_bundle_private_libs`, the idea of private library does not really works reliably due to the limitation of `ld.so`. A more reliable way of using private library is to link the private library statically into the shared object built with symbol visibility control and `-BSymbolic`, so that the shared object does not interfere with the outside world. To mitigate resulting code bloating, the techniques in https://github.com/apache/celix/issues/442 can be utilized. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org