unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Greg Troxel <gdt@ir.bbn.com>
To: Bruce Korb <bkorb@gnu.org>
Cc: guile-devel Development <guile-devel@gnu.org>
Subject: Re: Why is Guile now setting LD_LIBRARY_PATH?
Date: Mon, 10 Sep 2012 21:59:04 -0400	[thread overview]
Message-ID: <rmia9wxnwuv.fsf@fnord.ir.bbn.com> (raw)
In-Reply-To: <504E80EE.5070408@gnu.org> (Bruce Korb's message of "Mon, 10 Sep 2012 17:08:14 -0700")

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]


Bruce Korb <bkorb@gnu.org> writes:

> On 09/10/12 16:48, Bruce Korb wrote:
>>> $ guile --version
>>> guile (GNU Guile) 2.0.5
>>> Copyright (C) 2011 Free Software Foundation, Inc.
>> 
>> I added a couple of debug printf's after several hours chasing down
>> why my program was crashing:
>> 
>>> in main() LD_LIBRARY_PATH='EMPTY'
>>> in inner_main() LD_LIBRARY_PATH='/usr/lib64:/usr/lib64/guile/2.0/extensions'
>> 
>> It was crashing because it was linking against a library in /usr/lib64
>> instead of /usr/local/lib64.  Now I know why.
>> 
>> 1.  Why was this done?
>> 2.  Why no notice?  This is *BROKEN*.
>> 
>> libguile needs to be linked with -Wl,-rpath
>> -Wl,/usr/lib64/guile/2.0/extensions
>> instead of messing up your client's link/load.  ("/usr/lib64" should
>> not be needed.)
>> 
>> Distribution:  openSuSE 12.2  (Just in case they are not following your
>> build procedures and I need to harass them.)
>
>
> P.S.  the fix seems to be this, though, naturally, I hate it.
>
> static void
> inner_main(void * closure, int argc, char ** argv)
> {
>     atexit(done_check);
>     initialize(argc, argv);
>
>     {
>         char const * p = getenv("LD_LIBRARY_PATH");
>         if (p != NULL)
>             putenv("LD_LIBRARY_PATH=");
>     }

I don't follow why you think this is the right fix.  It seems that guile
(main) and libguile (library) should both not set LD_LIBRARY_PATH at
all.

Also, lib64 is a linuxism; BSDs have the architecture's libs in /usr/lib
and alternate ones in e.g /emul/netbsd32 (such as i386 libs on amd64
machines).  So setting LD_LIBRARY_PATH has to be done in an os and
arch-dependent way, which is complicated.

[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]

  reply	other threads:[~2012-09-11  1:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 23:48 Why is Guile now setting LD_LIBRARY_PATH? Bruce Korb
2012-09-11  0:08 ` Bruce Korb
2012-09-11  1:59   ` Greg Troxel [this message]
2012-09-11 13:12 ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2012-09-11 16:21 Bruce Korb
2012-09-13 23:30 ` Bruce Korb
2012-09-14 18:06   ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rmia9wxnwuv.fsf@fnord.ir.bbn.com \
    --to=gdt@ir.bbn.com \
    --cc=bkorb@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).