Hi,


My plugin is linked to an external lib.

When my plugin calls the init function of that external lib, it runs into
some problems with symbols (presumably the external lib init function calls
a dlopen to load some other files)

It seems the problem comes from the fact that VPP calls a dlopen of plugins.

A simple executable linking directly to the external library and calling
the init function of the external lib does not give the same problem.



I prototyped the whole scenario by making a stub executable (acting like
VPP executable). Also made a stub shared object (like the plugin) which
links to the external lib. Then I did a dlopen of this shared object from
my stub executable (just like VPP) where the shared object code calls the
init function of external lib. This reproduces the same problem as seen
with VPP. I then linked my stub executable with the external library in
addition and then everything worked fine.



In fact, I went ahead and changed the src/vlib/CMakeLists.txt so that
external lib links with vlib. This works fine for me.


I just wanted to find out, if there is any generic infra available to link
additional external libraries to say, vlib, without fiddling around with
the build system of VPP.

Regards,
Siddarth

On Thu, Jan 2, 2020 at 7:38 PM Damjan Marion <dmar...@me.com> wrote:

>
> 99% of vpp code is not in vpp executable so i wander why do you want to do
> that? both some of vpp standard libraries (vnet, vlib, ..) and some of vpp
> plugins are linked against libs, so to be able to help you i need more
> details...
>
> --
> Damjan
>
> On 2 Jan 2020, at 14:20, siddarth rai <sid...@gmail.com> wrote:
>
> 
> Hi,
>
> I mean only 'vpp executable'
>
> Regards,
> Siddarth
>
> On Thu, Jan 2, 2020 at 5:10 PM Damjan Marion <dmar...@me.com> wrote:
>
>>
>> what do you mean by “vpp executable lib”? can you provide more details
>> what exactly do you want to do?
>>
>> --
>> Damjan
>>
>> > On 2 Jan 2020, at 12:27, siddarth rai <sid...@gmail.com> wrote:
>> >
>> > 
>> > Hello,
>> >
>> > I am working on VPP 1908.
>> > I want to link some external non-vpp libraries to my vpp executable lib.
>> >
>> > Would it work if I add the path of external lib to vlib/CMakeLists.txt
>> file using 'LINK_LIBRARIES' ?
>> >
>> > Can anyone tell if this is the right way or if there is any other way ?
>> >
>> > Any help will be appreciated.
>> >
>> > Thank you,
>> > Siddarth
>> > -=-=-=-=-=-=-=-=-=-=-=-
>> > Links: You receive all messages sent to this group.
>> >
>> > View/Reply Online (#15013): https://lists.fd.io/g/vpp-dev/message/15013
>> > Mute This Topic: https://lists.fd.io/mt/69378301/675642
>> > Group Owner: vpp-dev+ow...@lists.fd.io
>> > Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [dmar...@me.com]
>> > -=-=-=-=-=-=-=-=-=-=-=-
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#15020): https://lists.fd.io/g/vpp-dev/message/15020
> Mute This Topic: https://lists.fd.io/mt/69378301/675642
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [dmar...@me.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15027): https://lists.fd.io/g/vpp-dev/message/15027
Mute This Topic: https://lists.fd.io/mt/69378301/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to