From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel Subject: Linking to libraries in the ELF? Date: Fri, 29 Jan 2021 17:20:40 +0100 Message-ID: <875z3fr9yf.fsf@telenet.be> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40417"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Jan 29 17:24:02 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5WZ0-000AQL-C9 for guile-devel@m.gmane-mx.org; Fri, 29 Jan 2021 17:24:02 +0100 Original-Received: from localhost ([::1]:52652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5WYy-0000Io-Sg for guile-devel@m.gmane-mx.org; Fri, 29 Jan 2021 11:24:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5WW1-0008Nq-2a for guile-devel@gnu.org; Fri, 29 Jan 2021 11:20:57 -0500 Original-Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:47096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5WVx-0002Fg-RW for guile-devel@gnu.org; Fri, 29 Jan 2021 11:20:56 -0500 Original-Received: from butterfly ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id NgLo2400d0mfAB401gLo1R; Fri, 29 Jan 2021 17:20:48 +0100 Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 29 Jan 2021 11:23:42 -0500 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20656 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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` --=-=-= Content-Type: text/plain Content-Disposition: inline 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] --=-=-= Content-Type: text/plain Hypothetical Scheme example: $ readelf -d $HOME/.guix-profile/lib/guile/3.0/site-ccache/chickadee/audio/vorbis.go --=-=-= Content-Type: text/plain Content-Disposition: inline Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libvorbisfile.so.3] 0x000000000000001d (RUNPATH) Library runpath: [[snip]] 0x0000000037146003 (: 37146003) 0x3000002 0x0000000037146002 (: 37146002) 0xe8 0x0000000037146000 (: 37146000) 0x20000 0x0000000037146001 (: 37146001) 0xaaa0 0x000000000000000c (INIT) 0x6bd0 0x0000000037146004 (: 37146004) 0x15530 0x0000000000000000 (NULL) 0x0 --=-=-= Content-Type: text/plain 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 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iI0EARYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBQ12BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iZ+AQCG4h1oNL2+eJBtNV79/rz+YlqB 8zgcQJSLMUZ96n3SlAD/WmGGkFOfIHjzbqZX7I5anABCuJJbdqxfyT0bMCc2zgs= =XYdu -----END PGP SIGNATURE----- --==-=-=--