[gambit-list] Dynamically loadable libraries on iOS

Marc Feeley feeley at iro.umontreal.ca
Thu Jul 3 23:37:28 EDT 2014


On Jul 3, 2014, at 7:05 PM, Álvaro Castro-Castilla <alvaro.castro.castilla at gmail.com> wrote:

> Hello,
> 
> <sorry for resposting, I accidentally removed some text from the email>
> 
> Being aware that Apple doesn't allow apps with dynamic libraries (except for those provided by them), I'm trying to make Gambit's dynamically loadable libraries work in the platform.
> 
> I can make them work well on the iOS simulator, but on the iPhone/iPad devices don't work. The funny thing is that as soon as the (load) procedure is called...
> 
> - When running with Xcode connection, the app stalls with no output or crash at all.
> - When running directly on the device without Xcode debugging connection, then it crashes.
> 
> All compiler and linker flags have been checked thoroughly. Compiling and linking work flawlessly, and the load procedure doesn't throw any error.
> 
> Is this an expected behavior? Any ideas of why this behavior might occur?

I think that is a constraint of the iOS (no dynamic loading of shared libs).

Is dynamic loading of shared libs really required by your application?  There is an alternative which gets similar effect… you bundle all the modules in a single executable file but only “preload” those that are required initially and “load” the rest on demand.  This can be done with the -nopreload compiler switch and the ##load-required-module function.

Marc




More information about the Gambit-list mailing list