Bug 8441 - libtool relinking using DESTDIR install is broken
Summary: libtool relinking using DESTDIR install is broken
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: MediumPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 17:24 CET by Adam Halim
Modified: 2025-03-03 09:42 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Adam Halim cendio 2024-11-05 17:24:25 CET
Broken out from bug 8402.

There is a bug in libtool [1] where doing a DESTDIR make install will relink against the wrong libraries.

In our case from bug 8402, we saw that libraries in util-linux linked against the system's glibc instead of the one in cenbuild.

It doesn't look like this bug has been fixed and has been in libtool for decades.

[1] http://savannah.gnu.org/support/?107416
Comment 1 Adam Halim cendio 2024-11-06 09:22:18 CET
According to the original bug report [1], this issue can be avoided by passing 
> --enable-fast-install
to configure. I've tried doing this when building util-linux, with no avail. The flag is even on by default, so I tried disabling it and still got the same result.


[1] http://savannah.gnu.org/support/?107416
Comment 2 Adam Halim cendio 2024-11-06 10:09:18 CET
To reproduce this error (with util-linux-2.32.1):

1. Add an 'exit 1' after %{_cendio_makeinstall} in util-linux.spec

2. ./repo/rebuild cendio-build-util-linux-x86_64

3. When the build exists, navigate to repo/rpmbuild/BUILD/util-linux-2.32.1/

4.
> $ objdump -t ./.libs/libmount.so.1.1.0 | grep clock
> 0000000000000000       F *UND*	0000000000000000              clock_gettime@@GLIBC_2.2.5
5.
> $ objdump -t ./.libs/libmount.so.1.1.0T | grep clock
> 0000000000000000       F *UND*	0000000000000000              clock_gettime@@GLIBC_2.17
The .so files that end with a T are generated during the install step and are
the ones that get installed. Unfortunately, they are linked to the system's
glibc, instead of the one in cenbuild.
Comment 3 Adam Halim cendio 2024-11-06 10:14:36 CET
To check if --enable-fast-install was respected, I looked in the BUILD/util-linux-2.32.1/ directory in "config.status":
> enable_fast_install='yes'
and in "libtool":
> fast_install=yes
Setting --enable-fast-install=no, "config.status":
> enable_fast_install='no'
and "libtool":
> fast_install=no
Comment 4 Adam Halim cendio 2024-11-14 08:32:50 CET
The issue that is seen when this happens is that when you're trying to use the wrongly linked library, you will get an error along the lines of:
> undefined reference to `memcpy@GLIBC_2.14'

Note You need to log in before you can comment on or make changes to this bug.