Re: Migrating shared library plugins to Cocoa Touch Frameworks
Re: Migrating shared library plugins to Cocoa Touch Frameworks
- Subject: Re: Migrating shared library plugins to Cocoa Touch Frameworks
- From: Pascal Bourguignon <email@hidden>
- Date: Fri, 02 Dec 2016 07:57:37 +0100
> On 2 Dec 2016, at 01:31, Jens Alfke <email@hidden> wrote:
>
>
>> On Dec 1, 2016, at 7:58 AM, Andreas Falkenhahn <email@hidden> wrote:
>>
>> My app supports external plugins. On macOS, Linux, and Windows those plugins
>> are just shared objects/dylibs (or DLLs) loaded via dlopen() (or LoadLibrary()
>> on Windows) at runtime.
>
> Does iOS still not support dlopen? I thought that, when iOS 8 granted the ability to load dynamic libraries, that dlopen would start working.
Yes, dlopen is supported in iOS 8 and following.
But of course, you can only open and link with libraries that have been code signed properly.
We use dlopen to load at run-time frameworks properly code signed and included in the application bundle
> What about the CFBundle API? Is that supported?
>
>> Now I'm looking for a way to port this design to iOS. The obvious choice seems
>> to be turning the individual plugins into individual Cocoa Touch Frameworks.
>> However, this results in the following big problem: The symbol names are the
>> same for every plugin, i.e. every plugin has a symbol named InitPlugin(), a
>> symbol named FreePlugin(), and so on.
>
> If you use frameworks then yes, you’ll have to rename the exported symbols in every plugin to be unique.
You don’t need to rename external symbols when you load a library dynamically. In that case, each library has its own symbol table, and you can search for symbols of same name in different libraries, using the dlsym function.
—
__Pascal Bourguignon__
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden