On Tuesday, June 22, 2010 01:26:23 am Samuel Thibault wrote:
> Hello,
>
> Jirka Hladky, le Mon 21 Jun 2010 18:54:47 +0200, a écrit :
> > I don't have "/usr/lib64" directory listed in
> > /etc/ld.so.conf. However, "/usr/lib64" is considered to be the
> > default lib location on 64-bit system.
>
> Ok. And libtool doesn't seem to add it by itself. I believe that's
> where the problem resides.
>
> > 1) Add /usr/lib64 into /etc/ld.so.conf. It works like a charm.
>
> Ok.
>
> > The problem is that I cannot use this change in the build environment
> > (on a cluster of build servers for compilation on different
> > architectures)
>
> Sure. On the long term I wouldn't recommend adding it anyway: it's
> already being looked for by the linker.
>
> > Samuel, do you have "/usr/lib64" directory listed in /etc/ld.so.conf
> > listed on your 64-bit Debian?
>
> No. Debian does not have a /usr/lib64 directory, 64bit versions are in
> /usr/lib. For biarch system, /usr/lib/x86_64-linux-gnu will be used.
>
> > 2) Second approach is to add
> > sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g'
> > libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g'
> > libtool into the %configure stage in rpm specs.
>
> Well, the real fix seems to me to fix
>
> sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
>
> into
>
> sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 $lt_ld_extra"
>
> on Fedora systems.
>
> > James, any feedback on it? I'm not sure if I should blame libtool or just
> > open BZ to add "/usr/lib64" into /etc/ld.so.conf.
>
> I believe in the current state of Fedora it's libtool that should be
> blamed. Or Fedora and libtool should talk to each other to determine
> how libtool is supposed to discover that /usr/lib64 is in the standard
> research path.
>
> Samuel
Hi Samuel,
I agree with you. It's issue with Fedora.
I got good explanation from Mamoru Tasaka at
Discussion of RPM packaging standards and practices for Fedora
mailing group:
=
Well, actually the upstream libtool (Fedora uses 2.2.6a) does not take
care of /usr/lib64 for rpath (and this seems the same for the latest 2.2.8).
What I usually say is that:
--
- Usually the reason that unneeded rpath /usr/lib64 is added to
the rebuilt binary is that the upstream developer uses libtool
which does not take special care of /usr/lib64 for
sys_lib_dlsearch_path_spec, while Fedora's libtool take care of
this by adding a patch. See the below patch:
http://cvs.fedoraproject.org/viewvc/rpms/libtool/devel/libtool-2.2.6a-
rpath.patch?content-type=text%2Fplain=co
So actually for most cases, the case that rpath /usr/lib64 is added
(only for 64 bits arch) can be avoided by
sed -i.libdir_syssearch -e \
'/sys_lib_dlsearch_path_spec/s|/usr/lib |/usr/lib /usr/lib64 /lib /lib64 |'
\
configure
i.e. just add the needed paths to sys_lib_dlsearch_path_spec in
configure (note that libtool in the build directory is generated by
configure) before calling %configure.
- You can alternatively do "autoreconf -fi", however calling autotools
is not recommended unless unavoidable.
--
So it is highly possible that if the upstream does not use Fedora (i.e. does
not
use patched libtool) rpath /usr/lib64 appears on Fedora.
And I just confirmed that this method works for this package (hwloc).
Regards,
Mamoru
==
So basically, until libtool patch will make through upstream into other
distributions it will be needed to patch configure script.
I'm glad that we have found an explanation. Problem is definitely not on your
side.
Thanks a lot!
Jirka