From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frank Webster Newsgroups: gmane.lisp.guile.bugs Subject: bug#21076: dynamic-link often fails to load libraries Date: Thu, 16 Jul 2015 19:52:34 +0300 Message-ID: <2096431437065554@web11m.yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1437083145 438 80.91.229.3 (16 Jul 2015 21:45:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jul 2015 21:45:45 +0000 (UTC) To: 21076@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Jul 16 23:45:34 2015 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZFqyC-0007N1-0o for guile-bugs@m.gmane.org; Thu, 16 Jul 2015 23:45:32 +0200 Original-Received: from localhost ([::1]:42111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFqyB-0006Ae-Az for guile-bugs@m.gmane.org; Thu, 16 Jul 2015 17:45:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFmap-0006YV-2S for bug-guile@gnu.org; Thu, 16 Jul 2015 13:05:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFmal-0005j0-3v for bug-guile@gnu.org; Thu, 16 Jul 2015 13:05:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFmak-0005hi-UX for bug-guile@gnu.org; Thu, 16 Jul 2015 13:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZFmak-0000mt-Cw for bug-guile@gnu.org; Thu, 16 Jul 2015 13:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Frank Webster Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 16 Jul 2015 17:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21076 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14370662792989 (code B ref -1); Thu, 16 Jul 2015 17:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jul 2015 17:04:39 +0000 Original-Received: from localhost ([127.0.0.1]:51346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZFmaM-0000m9-US for submit@debbugs.gnu.org; Thu, 16 Jul 2015 13:04:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32967) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZFmOv-0000U8-NZ for submit@debbugs.gnu.org; Thu, 16 Jul 2015 12:52:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFmOp-00051g-H8 for submit@debbugs.gnu.org; Thu, 16 Jul 2015 12:52:44 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFmOp-00051c-E9 for submit@debbugs.gnu.org; Thu, 16 Jul 2015 12:52:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFmOo-0003Bw-Co for bug-guile@gnu.org; Thu, 16 Jul 2015 12:52:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFmOk-00050T-CK for bug-guile@gnu.org; Thu, 16 Jul 2015 12:52:42 -0400 Original-Received: from forward19m.cmail.yandex.net ([5.255.216.150]:36255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFmOk-0004zg-1k for bug-guile@gnu.org; Thu, 16 Jul 2015 12:52:38 -0400 Original-Received: from web11m.yandex.ru (web11m.yandex.ru [IPv6:2a02:6b8:0:2519::211]) by forward19m.cmail.yandex.net (Yandex) with ESMTP id 7811520773 for ; Thu, 16 Jul 2015 19:52:35 +0300 (MSK) Original-Received: from 127.0.0.1 (localhost [127.0.0.1]) by web11m.yandex.ru (Yandex) with ESMTP id E461C2F216F3; Thu, 16 Jul 2015 19:52:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1437065555; bh=sZXZisPAgTE6FYBp74ETC7AVR3oFSVp95CiTSK5xyX4=; h=From:To:Subject:Date; b=Vx4yl2tAbeJLRVfQquR84c9FEFdjn3weDaw3PcbON52qPvfAzEt1SJe/KCViqAJBw Sss/6zwqL/aba+js9tD/GUwp54jeZZyvf7ZksN7PDtgbB1XNER4Xc7ejwIHcPOKAAs v+ytSMQqUa87MFN9FHre9RIJkbxR9SDVTEzA++LI= Original-Received: by web11m.yandex.ru with HTTP; Thu, 16 Jul 2015 19:52:34 +0300 Envelope-From: f-webster@yandex.com X-Mailer: Yamail [ http://yandex.ru ] 5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Thu, 16 Jul 2015 13:04:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Thu, 16 Jul 2015 17:45:26 -0400 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7811 Archived-At: On my Debian system, `dynamic-link' often fails to load shared libraries: Loading using a versioned soname never works: scheme@(guile-user)> (dynamic-link "libGL.so.1") ERROR: In procedure dynamic-link: ERROR: In procedure dynamic-link: file: "libGL.so.1", message: "file not found" Loading without a library extension doesn't work unless the corresponding *-dev package is installed: scheme@(guile-user)> (dynamic-link "libGL") ERROR: In procedure dynamic-link: ERROR: In procedure dynamic-link: file: "libGL", message: "file not found" It is supposed to work with or without the extension, however because of limitations in the underlying lt_dlopenext function in libtool, neither works. The first doesn't work because contrary to its documentation, lt_dlopenext doesn't always try loading the bare filename first, without appending an extention. The second doesn't work because the versioned soname extension (.so.1) isn't among the ones that lt_dlopenext tries to append. It does try the unversioned extension (.so), but in Debian the unversioned symlink is only available when the corresponding *-dev package is installed. Here is a related libtool bug report: https://debbugs.gnu.org/8976 Note that there are arguably two distinct issues: (1) lt_dlopenext not trying the bare filename in all cases (2) lt_dlopenext not trying versioned soname extensions. Obviously one way to address this would be to fix these two issues in lt_dlopenext in libtool. Alternatively, the (system foreign) module in guile could provide a simple low-level wrapper around lt_dlopen, and possibly implement the higher level functionality of `dynamic-link' (additional search paths, guessing extensions etc.) in scheme.