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 ;-)

Reply via email to