[Mono-dev] DllImport("__Internal") and libMonoPosixHelper static build
monoman at gmail.com
Fri Apr 13 18:34:41 UTC 2012
AFAIK, the DLLImport binding depend on loading information of dynamic
libraries, if you want to call something statically linked in the runtime
you'll need to move to using internal calls, but that means an extensive
rewrite of the the affected libraries both managed and native as the
protocol doesn't include automatic marshaling of managed types, and correct
versioning is a must to avoid crashes on incompatible ABIs.
Another possibility is to change the dynamic libraries binding mechanism to
search for statically linked symbols, not sure how complex this would be.
The best alternative is to fix the loader and keep the .so files around.
Just my two cents,
Rafael "Monoman" Teixeira
"The most exciting phrase to hear in science, the one that heralds new
discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
US science fiction novelist & scholar (1920 - 1992)
On Thu, Apr 12, 2012 at 4:43 AM, ralphbariz <ralph.bariz at gmail.com> wrote:
> I'm trying to compile a static one binary mono(Because the target system
> an incompatible loader).
> First I got mono to build statically, but without libMonoPosixHelper in the
> archive. After a few tries, I got also this, changed all DllImport(MPH)
> calls in Mono.Posix.dll to DllImport("__Internal"), it still gives me a
> TypeInitializationexception when I try to access the stat symbol of the
> libMonoPosixHelper. With objdump I looked inside, the symbols of
> libMonoPosixHelper are all inside the archive, so what am I doing wrong?
> The script used to build: http://pastebin.com/t7dqdBYn
> View this message in context:
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list