Reputation: 11
I'm calling Ada code from a Java app in Linux. The Ada code resides in a dynamic lib (shared-library) with a C-api.
Linking the .so from Java works. Likewise calling the C-functions in the .so and furthermore call the Ada code. But that's where it ends...
The call to Ada works fine, but it seems that Ada doesn't have a (secondary) stack. I know that a call to adainit() has to take place, either auto or manual. I've tried a number of switches for the binder with no luck, it wont generate a 'b-*' file containing elaboration base code (and containg adainit() that is).
When building the .so I've also tried binding with -Dnn (like -D20k and -D10m) and also tried to call a task with the 'secondary_stack_size' directive. But the task itself won't be created due to no stack, neither static or dynamic creation works.
Is it impossible to call a ada-package from c in an '.so'?
Any ideas?
(CentOS 8.0, Gnat PRO 21.0)
Upvotes: 1
Views: 212
Reputation: 1427
Try to build stand-alone library. This way it will initialize itself during the loading. Otherwise you need to call adainit
yourself before the first call to an Ada function.
Upvotes: 4