Shared libraries with common statically linked library

19 views
Skip to first unread message

Miguel Trigueira

unread,
Jan 3, 2017, 1:39:42 PM1/3/17
to NativeLibs4Java
Hi,

I'm trying to solve a bit of a conundrum. I have two libraries that have statically linked a third separately into each. However when I use bridj, the calls are always mapped into the first loaded library.

Ascii art follows:

How libraries are linked

   BridJ
   |   |
   v   v
libA   libB
|         |   Statically linked
v         v
libC   libC

This produces libA.so and libB.so

The problem is when accessing using BridJ the following happens:

What happens to the calls

   BridJ
   |   |
   v   v
libA   libB
|     /   
v    v    
 libC    libC

This causes problems because libA and libB assume they have their own independent instance of libC but BridJ is using only the one.

Currently we are working around this by using a separate JVM, is it possible to get BridJ to do this?
Reply all
Reply to author
Forward
0 new messages