[yocto] CommonAPI *.so bindings

Clemens Lang Clemens.Lang at bmw-carit.de
Wed Nov 30 08:25:09 PST 2016


Hi Pawel,

Pawel Suchy <pawel.suchy at delphi.com> wrote:

> That is causing a problem with binding CommonAPI dynamic libraries via  
> commonapi.ini.
> The commonapi.ini file contains sections where dependencies to proxy  
> objects could be defined:
> [proxy]  
> local:commonapi.examples.Test:commonapi.examples.Test=libTest-DBus.so
>
> But it cannot take link to versioned library because of that code:
> http://docs.projects.genivi.org/ipc.common-api-runtime/3.1.5/Runtime_8cpp_source.html#l00283
>
>  Runtime::loadLibrary(const std::string &_library) {
> 321  std::string itsLibrary(_library);
> 322
> 323  // TODO: decide whether this really is a good idea...
> 324  #ifdef WIN32
> 325  if (itsLibrary.rfind(".dll") != itsLibrary.length() - 4) {
> 326  itsLibrary += ".dll";
> 327  }
> 328  #else
> 329  if (itsLibrary.rfind(".so") != itsLibrary.length() - 3) {
> 330  itsLibrary += ".so";
> 331  }
> 332  #endif
>
> Questions:
> 1. How to solve best this?

Our solution to that is to not rely on runtime loading of CommonAPI  
libraries and just link the libraries that you need into the binary  
directly, in which case this code will not be run at all. If your project  
does not need the ability to switch between different communication  
backends of CommonAPI, that should also work for you.

Note that you may need -Wl,--push-state,--no-as-needed,-library,--pop-state  
depending on what your libraries look like.


HTH,
Clemens
-- 
BMW Car IT GmbH
Clemens Lang
Spezialist Entwicklung
Lise-Meitner-Straße 14
89081 Ulm

Tel: +49-731-37804182
Mail: clemens.lang at bmw-carit.de
Web: http://www.bmw-carit.de
--------------------------------------------------------------------
BMW Car IT GmbH
Geschäftsführer: Michael Würtenberger und Alexis Trolin
Sitz und Registergericht: München HRB 134810
--------------------------------------------------------------------


More information about the yocto mailing list