unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Rob Browning <rlb@defaultvalue.org>
Cc: guile-devel@gnu.org
Subject: Re: packaging the add-on libs...
Date: Fri, 11 Oct 2002 10:59:53 -0500	[thread overview]
Message-ID: <87zntl0xvq.fsf@raven.i.defaultvalue.org> (raw)
In-Reply-To: <20021011094150.GA3235@www> (tomas@fabula.de's message of "Fri, 11 Oct 2002 11:41:50 +0200")

tomas@fabula.de writes:

> Yes, I know (that's why I know I was taking risks ;-). I felt uneasy
> then and still feel uneasy abut it (see below).

Well FWIW, I did some experimentation, and at least on debian systems,
during the process of re-building/uploading which would happen every
time we release a new major version of libguile, I determined that you
are likely to end up with cross-version-links.

In my example (imagine libbase is libguile):

  $ ldd .libs/some-app-2
	libuses-base-foo2.so.2 => not found
	libbase2.so.2 => not found
	libuses-base-bar.so.1 => not found
	libbase1.so.1 => not found
	libc.so.6 => /lib/libc.so.6 (0x40027000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Note that in the expirimental tree, some-app-2 was only linked via
libtool against libuses-base-bar and libuses-base-foo2, the two
libbase links were pulled in because uses-base-foo2 and uses-base-bar
were originally linked against two different versions of libbase.

I don't know if how this would work on other platforms, but what's
interesting is that at runtime, it appears that the loader resolves
any duplicate symbols in favor of the first library listed on the
libtool link line.  In this case, even though libuses-base-foo2 was
linked against libbase2, when it calls libbase_init, it prints the
message I put in libbase1's libbase_init.  There are no linkage
warnings.  libuses-base-bar was listed first on the libtool link line,
and if I reverse that so that libuses-base-foo2 comes first, then we
see the messages from libbase2.

In some sense, this could be seen as a good thing, and would hide most
problems, i.e. even though you have dual linkage, you always get the
symbols from just one version of the libs, but in reality I believe
it's a potential disaster since (for example) libuses-base-foo2 was
built using libbase2's headers, and libuses-base-bar was built using
libbase1's headers.  This means that one of them is going to be
operating on libbase data structures with the wrong set of macros.
Another potential problems comes if libbase2 adds new functions or
deletes old ones, then depending on whether libbase2 or libbase1 takes
precedence in the "dual link", you'll have some functions from one
version of libbase and some from another.

> Yes, kind of. Only that I'd substitute ``that aren't supposed to be
> directly linkable by'' for ``that have to go with guile to be linked
> by...''
>
> In other words, if you need guile in conjunction with libfoo, then
> libfoo has no business in /usr/lib or /usr/local/lib -- but rather
> in /usr/lib/guile/1.6/ (or something like that). IMHO, of course.

The main problem with this is that any apps or libs linked against
these "add-on" libs will have to do something special to access the
libs, i.e. -rpath, mangling LD_LIBRARY_PATH, etc.  and as we've
discussed, there are some definite issues with doing that portably,
and in a way that doesn't have the potential to interact badly with
other libs that might do the same thing, so we'd have to be cautious
when considering this approach.  For libs no-one's ever allowed to
link directly to, there's no problem.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2002-10-11 15:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10  5:03 packaging the add-on libs Rob Browning
2002-10-10  7:12 ` tomas
2002-10-10 15:22   ` Rob Browning
2002-10-11  9:41     ` tomas
2002-10-11 15:59       ` Rob Browning [this message]
2002-10-14 11:34         ` tomas
2002-10-11 16:14       ` Rob Browning
2002-10-11 17:10         ` Greg Troxel
2002-10-11 18:26           ` Rob Browning
2002-10-11 20:37             ` Greg Troxel
2002-10-10 12:51 ` Greg Troxel
2002-10-10 15:37   ` Rob Browning

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=87zntl0xvq.fsf@raven.i.defaultvalue.org \
    --to=rlb@defaultvalue.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).