[-- Attachment #1.1: Type: text/plain, Size: 375 bytes --]
Hi guilers,
I've got this crazy idea a few days ago, about the FFI interface.
When a program written in C is compiled with some shared libraries,
these libraries are referred to in special [insert ELF terminology
here] of the binary. I wonder if it would be reasonable and feasible
to do something similar for compiles guile modules?
C example:
$ readelf -d `which guile`
[-- Attachment #1.2: Type: text/plain, Size: 429 bytes --]
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libguile-3.0.so.1]
0x0000000000000001 (NEEDED) Shared library: [libgc.so.1]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libffi.so.7]
[snip]
0x000000000000001d (RUNPATH) Library runpath: [[snip]]
[snip]
[-- Attachment #1.3: Type: text/plain, Size: 115 bytes --]
Hypothetical Scheme example:
$ readelf -d $HOME/.guix-profile/lib/guile/3.0/site-ccache/chickadee/audio/vorbis.go
[-- Attachment #1.4: Type: text/plain, Size: 539 bytes --]
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libvorbisfile.so.3]
0x000000000000001d (RUNPATH) Library runpath: [[snip]]
0x0000000037146003 (<unknown>: 37146003) 0x3000002
0x0000000037146002 (<unknown>: 37146002) 0xe8
0x0000000037146000 (<unknown>: 37146000) 0x20000
0x0000000037146001 (<unknown>: 37146001) 0xaaa0
0x000000000000000c (INIT) 0x6bd0
0x0000000037146004 (<unknown>: 37146004) 0x15530
0x0000000000000000 (NULL) 0x0
[-- Attachment #1.5: Type: text/plain, Size: 195 bytes --]
This would require fleshing out some details though,
such as when to use RUNPATH and when not, cross-platform support,
where to find the libraries, some things I probably forgot.
WDYT?
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 259 bytes --]