unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Linking to libraries in the ELF?
@ 2021-01-29 16:20 Maxime Devos
  0 siblings, 0 replies; only message in thread
From: Maxime Devos @ 2021-01-29 16:20 UTC (permalink / raw)
  To: guile-devel


[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-29 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 16:20 Linking to libraries in the ELF? Maxime Devos

unofficial mirror of guile-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-devel/0 guile-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-devel guile-devel/ https://yhetil.org/guile-devel \
		guile-devel@gnu.org
	public-inbox-index guile-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.devel
	nntp://news.gmane.io/gmane.lisp.guile.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git