From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel Subject: dynamic-link issue: does not always load Date: Fri, 20 Mar 2020 17:00:11 -0700 Message-ID: <291418a1-d34d-b6c5-9e90-8f7b6972fcdf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="19465"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Mar 21 01:00:30 2020 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 1jFRZ0-0004xM-3t for guile-devel@m.gmane-mx.org; Sat, 21 Mar 2020 01:00:30 +0100 Original-Received: from localhost ([::1]:60326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFRYx-00048E-UJ for guile-devel@m.gmane-mx.org; Fri, 20 Mar 2020 20:00:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35769) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFRYl-000487-Qe for guile-devel@gnu.org; Fri, 20 Mar 2020 20:00:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFRYk-0001p5-MT for guile-devel@gnu.org; Fri, 20 Mar 2020 20:00:15 -0400 Original-Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:32828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFRYk-0001m5-EP for guile-devel@gnu.org; Fri, 20 Mar 2020 20:00:14 -0400 Original-Received: by mail-pf1-x42b.google.com with SMTP id j1so1421550pfe.0 for ; Fri, 20 Mar 2020 17:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=E2xd2Xwgm49fkvoQ+/iBdDlSKOUELcEVJFYK/ntL0qw=; b=SB64N0WUa4J7Rzqv6ijVA94M5szU3nLvR1hdC3NLre6KOIhzZUxbnoE7VMC73RLTg+ A+GBJj8P8+v30Kv2E8EYZtnKmcFj/QsOVIMp3FkeV9T5MGwNGvT23wgtRg7FYskUIYkb tCBAfVpVLY9pLc9rPwI8YLuyKXCyuZtjERrkv5b9/b8y/+McQLoDtiuSZy925BVhqmAg mIEVK3f7ak/a5tNLnKmb2YoV+j71fHZSX+NbxzeUx4udnI9FXbNrDOeDT5wahJtupe8Y SjIWReR4a7jsd+Mc0vbArRR6GUpy8nQDoFzx7LCRTRPRfAsjtK288CKDbubniLVnhLQn oyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=E2xd2Xwgm49fkvoQ+/iBdDlSKOUELcEVJFYK/ntL0qw=; b=kQYGPN6lgnY9URTu6PWEzkZQxwm9Y2XSWQD/5k5D1fhsTXQzlRF1wDmnSOZOnR8MIs u6thK4aCz5sSK7x9BPNdYS6qchZUDXNVdiTVEF6IKP952vPJjyEhhaV1dDCJZDMvYuLI +fcT/E5NolJKvQE2M4FnrD8GKuyNeHbw6YO+2xIKcDKEm0BDi7NHX5HS5aQaO42TnMtV mdhBgXwoBZCnzI93AhfF2Hu3oIo1dEOqCGDN9SGdJYHu0uKqQQ5QIzhL6iIyTgRSMz3u au+IHLXdeCBwhpsct5zxhVNKDLFWg8QWmKTzZWiyra5pnV7YYUosfsWEuIAessbGDQ/s Xi9g== X-Gm-Message-State: ANhLgQ3plbmjWgfRO7hV8xNMw7YaRuf0ZOp2v1S8KzYL4WdT6uBFsO7i egAfAmsLYRfczMNwP09c+OuLIC5g X-Google-Smtp-Source: ADFU+vvf496dBBxmy9MiTImiGTM86jICDTPMhx9h9At/XEJqSZKsmvnb9jU0V6TBpn+BbG8TE/fWFQ== X-Received: by 2002:a62:160b:: with SMTP id 11mr12225060pfw.189.1584748812751; Fri, 20 Mar 2020 17:00:12 -0700 (PDT) Original-Received: from [192.168.2.183] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id n100sm5070375pjc.38.2020.03.20.17.00.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Mar 2020 17:00:12 -0700 (PDT) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b 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:20453 Archived-At: There is an old bug report #21076 on dynamic-link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21076 Say you have a file libyaml.0.so-2, dynamic-link can't load it     (dynamic-link "libyaml.0.so-2") => exception even if there is a file libyaml.so:   $ cat /usr/lib64/libyaml.so   INPUT(libyaml-0.so.2) it fails with (dynamic-link "libyaml") I have submitted the following patch, which at least makes the first version work.  If you think this is a libtool but you may be right, but the bug report on this has not been touched for 8 years: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8976 This patch fixes issue with libtool and OSes which use non-standard extensions for shared libraries.  The libltdl function lt_dlopenext expects the argument to have a standard extension or no extention.  Arguments reflecting shared object files with non-standard extensions will fail to load.  For example, my system has /usr/lib64/libyaml-0.so.2.  w/o this patch (dynamic-link "libyaml-0.so.2") does not work; with it, it does.  Go figure. --- libguile/dynl.c-orig    2020-03-20 05:56:42.101214929 -0700 +++ libguile/dynl.c    2020-03-20 05:57:40.432893330 -0700 @@ -69,7 +69,10 @@      handle = lt_dlopen (NULL);    else      { -      handle = lt_dlopenext (fname); +      handle = lt_dlopen (fname); + +      if (handle == NULL) +         handle = lt_dlopenext (fname);        if (handle == NULL  #ifdef LT_DIRSEP_CHAR