public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Steven J. Long" <slong@rathaus.eclipse.co.uk>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Re: libtool lt_dlopenext vs. gen_ld_script: breakages at runtime
Date: Wed, 8 Jan 2014 08:59:14 +0000	[thread overview]
Message-ID: <20140108085914.GA3346@rathaus.eclipse.co.uk> (raw)
In-Reply-To: <robbat2-20140105T033326-886000793Z@orbis-terrarum.net>

On Sun, Jan 05, 2014 at 04:09:12AM +0000, Robin H. Johnson wrote:
> Summary:
> --------
> gen_ld_script is removing a vital unversioned symlink from some packages, and
> this breaks libtool lt_dlopenext consumers at runtime.

> lt_dlopenext is given the basename of a library to find. In this case, the
> (modified) code tries both libusb and libusb-0.1, with slightly different failures:
> 
> 1. lt_dlopenext cannot parse linker scripts at all, so the libusb.so from
>    gen_ld_script cannot be opened.
> 2. lt_dlopenext only tries to append .so, it doesn't add version specifiers.
> 
> If I manually add a symlink:
> /lib64/libusb-0.1.so -> /lib64/libusb-0.1.so.4
> then lt_dlopenext succeeds.

> Before gen_ld_script runs, it has the library and two symlinks in /usr/lib64:
> /usr/lib64/libusb-0.1.so.4.4.4
> /usr/lib64/libusb-0.1.so.4 (symlink)
> /usr/lib64/libusb.so (symlink)
> At this stage, lt_dlopenext works still.
> 
> Now after gen_ld_script, the unversioned symlink is replaced by a linker
> script. The versioned symlink and base file have moved to /lib64.

> /usr/lib64/libusb.so  (from gen_ld_script)
> /lib64/libusb-0.1.so.4.4.4
> /lib64/libusb-0.1.so.4 (symlink to 4.4.4)

> Since lt_dlopenext cannot handle the linker script, and the unversioned symlink
> is gone, we now get a failure.
> 
> Proposed Fix:
> -------------
> I would like to propose that gen_ld_script does NOT remove the unversioned
> symlinks, but instead moves them along with the versioned symlinks.

Agreed, a minor change to what it does which makes a lot of sense, meaning
/lib is consistent with what was installed, and the script remains in /usr.

I concur also that static archives belong in /usr; they're only used at
link-time. The only thing I'd ask is whether we can't just install libs
to /lib as WilliamH suggested, and then move the static ones instead in
the image, before emerge makes a pkg.

I don't know what libtool's up to with *.la ofc, but I thought we stopped
installing those a while back? Or it may just be that people mask them.

> [1] I do half-expect vapier, flameeyes or patrick to shoot me down, and tell me
> the package is doing something wrong, but I've also got a chance of this
> actually being a system breakage.

The thing that troubles me is no symlink being installed for 0.1.so - I thought
that was required. Doesn't affect that your proposed change is an improvement,
though, and should definitely go ahead, imo.

Regards,
steveL.
-- 
#friendly-coders -- We're friendly, but we're not /that/ friendly ;-)


  parent reply	other threads:[~2014-01-08  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-05  4:09 [gentoo-dev] libtool lt_dlopenext vs. gen_ld_script: breakages at runtime Robin H. Johnson
2014-01-06 19:23 ` William Hubbs
2014-01-06 19:31   ` Robin H. Johnson
2014-01-08  8:59 ` Steven J. Long [this message]
2014-01-08 20:14 ` Peter Stuge
2014-01-08 20:27   ` Robin H. Johnson
2014-01-08 20:43     ` Rick "Zero_Chaos" Farina
2014-01-12 11:15       ` [gentoo-dev] " Steven J. Long

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

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

  git send-email \
    --in-reply-to=20140108085914.GA3346@rathaus.eclipse.co.uk \
    --to=slong@rathaus.eclipse.co.uk \
    --cc=gentoo-dev@lists.gentoo.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