GNU bug report logs - #24296
lt wrapper script puts the .libs rpath last instead of first

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: libtool; Reported by: Ray Satiro <raysatiro@HIDDEN>; dated Wed, 24 Aug 2016 05:37:01 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jun 2017 04:37:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 28 00:37:08 2017
Received: from localhost ([127.0.0.1]:41417 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dQ4ix-0006iv-Fl
	for submit <at> debbugs.gnu.org; Wed, 28 Jun 2017 00:37:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47357)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raysatiro@HIDDEN>) id 1dQ2DA-0002zS-DU
 for submit <at> debbugs.gnu.org; Tue, 27 Jun 2017 21:56:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1dQ2D3-0000cI-QF
 for submit <at> debbugs.gnu.org; Tue, 27 Jun 2017 21:56:02 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: **
X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_50,FORGED_YAHOO_RCVD,
 FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:50280)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <raysatiro@HIDDEN>) id 1dQ2D3-0000c9-N6
 for submit <at> debbugs.gnu.org; Tue, 27 Jun 2017 21:56:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38316)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1dQ2D2-0001LQ-C5
 for bug-libtool@HIDDEN; Tue, 27 Jun 2017 21:56:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1dQ2Cz-0000Zh-AA
 for bug-libtool@HIDDEN; Tue, 27 Jun 2017 21:56:00 -0400
Received: from nm10-vm4.bullet.mail.gq1.yahoo.com ([98.136.218.95]:37956)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1dQ2Cz-0000Yi-04
 for bug-libtool@HIDDEN; Tue, 27 Jun 2017 21:55:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1498614954; bh=KVeimxW996G2n5jsFTGh0VY9ki+2hji3IxJG4whBOTc=;
 h=Subject:From:To:References:Date:In-Reply-To:From:Subject;
 b=DWqJFVjtwVasfxLHFKh9o557Pbew8Mq3UEnQ131/W9YlAzBmHCkSLNxY+QEKmZv92qpU5BvmN6Y+IjB4WZgyQ1y1eagM7uBVKw1DBQ8DXrMXG1UH8X46aTjWsjpmuijjJ310mbL/PjVD4NjQlIigqgw7FpRVUHGbP6Mu1QF7oouGr2tJ8lJwneHondU/14OC36miK8m+UMrqiy5SVTPqcBfkhmMLLlok6b3f3PSK+MF7kaipqfUr/cjWIfumGzqXAFb618SfyVKYols9hSgSSzFMHUx3KFYOBmazybWeN7A37NyL14wFylQMMjKTl8CuXOS4021PSAO1mK3Jr+wZBw==
Received: from [98.137.12.61] by nm10.bullet.mail.gq1.yahoo.com with NNFMP;
 28 Jun 2017 01:55:54 -0000
Received: from [208.71.42.196] by tm6.bullet.mail.gq1.yahoo.com with NNFMP;
 28 Jun 2017 01:55:53 -0000
Received: from [127.0.0.1] by smtp207.mail.gq1.yahoo.com with NNFMP;
 28 Jun 2017 01:55:53 -0000
X-Yahoo-Newman-Id: 980062.60563.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: aMHTyj4VM1kUXbJHJdSCPLJ5ck0ae3UyS2uWu_kPK.m8SN.
 gUWOmfRSdkU_isb0.lroWKB94Q_9TnS.yXwY.wYOpJp6Au20sg0SKW6spUnk
 cgrukt37mFR8T3BzJSwVPlRxGi83G38wIV0REx8zlg1zMOXB.VUdrG8FUq8A
 7i4f27hGxwemeS3fhciJcPF32xWyGo_ptNEsJZqUKgU9Z9IlhwnFwpZuISI3
 PN1n5S9ctVAPj6NsqjY5q_CkTGL7K3wJOcfIVgcDpc1Sl9smO6_Rc5QkpXFO
 hZ6ZeEW7435.vBqgIFa31NGW1x1IEvSrgdIukGkLAdYAT4.rv21U3uLnT.z_
 mwJusZLR8LqBvk76P5mA..MvsYpIUBWYpWrWIzxPdArJLr65QFxIDFkvW5x2
 aBdQhO08aBAeV5PiLDvx9dmnNYasikG9vjHHRdP9UUJbqKTUFzQCQ3AFHmmC
 Bw0XDuDIjWQx4ev6YD9Sq.k2NhjumYNbLzRvIikHKMEtOKRND.sJ_7Q0k15B
 eqNaGprtOFe7cwAgOBwTNdo4zMRybLN1GTzTteG9JRXaxOQTemv0a.TTWac4
 6QcPA0i07r8korTox.X8NNEBaCHAEag--
X-Yahoo-SMTP: 9Tlp3zGswBAMIZY7LhANokCU9rJ2SQ--
Subject: Re: lt wrapper script puts the .libs rpath last instead of first
From: Ray Satiro <raysatiro@HIDDEN>
To: bug-libtool@HIDDEN
References: <bc90eda5-ae01-f51a-6600-321a5d590605@HIDDEN>
Message-ID: <589d803b-c64b-5105-b79c-7072097ca7ef@HIDDEN>
Date: Tue, 27 Jun 2017 21:55:35 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <bc90eda5-ae01-f51a-6600-321a5d590605@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.3 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 28 Jun 2017 00:37:05 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 8/24/2016 1:31 AM, Ray Satiro wrote:
> I am building a shared library and a program that uses it and I need
> to run it uninstalled. libtool creates a lt- version of the program
> with an rpath to the uninstalled shared library, but the problem is I
> also set rpaths and libtool puts its rpath after mine instead of before.
>
> I build curl in Ubuntu similar to this:
>
> LDFLAGS="-Wl,-rpath,/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib"
> ./configure [OPTIONS REMOVED FOR BREVITY]
> make
>
> I end up with
>
> lib/.libs/libcurl.so
> src/curl    <--- libtool wrapper script
> src/.libs/lt-curl
>
> When I run src/curl it execs lt-curl which has an rpath for
> /usr/local/lib before lib/.libs, and so it loads the libcurl.so from
> /usr/local/lib. Reviewing the wrapper script I can see libtool appends
> its rpath instead of putting it first. relink-command looks basically
> like this:
>
> gcc -O2 -Wno-system-headers -Wl,-rpath -Wl,/usr/local/ssl/lib
> -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -o
> \$progdir/\$file [OBJECTS REMOVED FOR BREVITY] -L/usr/local/ssl/lib
> -L/usr/local/lib ../lib/.libs/libcurl.so -lssl -lcrypto -lz -Wl,-rpath
> -Wl,/home/owner/curl-7.50.1/lib/.libs
>
> I initially reported this to the cURL project, which I am a part of.
> The bug is https://github.com/curl/curl/issues/432 but I couldn't
> figure it out.
>
> I attempted to work around this problem when I know src/curl is used
> by using LD_PRELOAD, like
>
> LD_PRELOAD=$PWD/lib/.libs/libcurl.so make test
>
> Recently though I realized a bunch of our tests are overriding
> LD_PRELOAD, and I don't have a work around for those cases at the moment.
>
> I believe appending the lib/.libs rpath instead of prepending it could
> be a bug in libtool.
>
> libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1
> Ubuntu 16 LTS
> 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64
> x86_64 x86_64 GNU/Linux
>

Hi I e-mailed this over 10 months ago but have not received a reply,
does it have an official bug number or ticket, is anyone aware of it?




Information forwarded to bug-libtool@HIDDEN:
bug#24296; Package libtool. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Aug 2016 05:36:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 24 01:36:22 2016
Received: from localhost ([127.0.0.1]:38586 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bcQrO-0000oz-3e
	for submit <at> debbugs.gnu.org; Wed, 24 Aug 2016 01:36:22 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41748)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raysatiro@HIDDEN>) id 1bcQnC-0000id-Eu
 for submit <at> debbugs.gnu.org; Wed, 24 Aug 2016 01:32:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1bcQn6-0005je-3s
 for submit <at> debbugs.gnu.org; Wed, 24 Aug 2016 01:31:57 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: **
X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_50,FORGED_YAHOO_RCVD,
 FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56261)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1bcQn6-0005jT-0K
 for submit <at> debbugs.gnu.org; Wed, 24 Aug 2016 01:31:56 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60946)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1bcQn3-0003Mw-GC
 for bug-libtool@HIDDEN; Wed, 24 Aug 2016 01:31:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1bcQmz-0005io-9i
 for bug-libtool@HIDDEN; Wed, 24 Aug 2016 01:31:52 -0400
Received: from nm19-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.162]:55233)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <raysatiro@HIDDEN>) id 1bcQmz-0005iK-4I
 for bug-libtool@HIDDEN; Wed, 24 Aug 2016 01:31:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1472016708; bh=cXL28YeqfXUrYGhbZo5bapyqTpcXmFMSOGsRpKrB5cA=;
 h=To:From:Subject:Date:From:Subject;
 b=ehEoF4h/yHHVL4wJ6p1U0n4et/SCWQez/sgn8RCLariwGcNVq9bxfcJ2lmMEU+LasIqH72l0qBYvPBsdY6kxmIPMUmrjpe6HEKUhtTM8Qp2MVBNyEMzIx5DYqUmVPaCv5EtwXiZsv35u+wZXauXn/TtAgSpw0cTP+Wpja0+X80qBwhpDZA7gNO9JO1KlPW0E58XaoX6tTWa3LdKrDXyZYg4/v5CIwb7lhttBYtytK5ExqpMwlUBQJEYFeTAu9Dj1ELbKg2WJEAL0Qa6zq3duOM+Dq3HYTvBSytg4/Re1FcnuPxfWgdIyxCwPXKWQh/YOpcUP0RAAW/NPpXtJBVDTwg==
Received: from [66.196.81.170] by nm19.bullet.mail.bf1.yahoo.com with NNFMP;
 24 Aug 2016 05:31:48 -0000
Received: from [68.142.230.78] by tm16.bullet.mail.bf1.yahoo.com with NNFMP;
 24 Aug 2016 05:31:48 -0000
Received: from [127.0.0.1] by smtp235.mail.bf1.yahoo.com with NNFMP;
 24 Aug 2016 05:31:48 -0000
X-Yahoo-Newman-Id: 195657.46874.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: v5sxENQVM1mWtMkXUZhIco6kswj9.fBfObAtL18K5v1CUM_
 X4ps2KTtLtLZzp5eABisUmgQnAjKxiUj2Z4GdqZg1rAslzB0j7.dB5htclWK
 dyQ3aD1WKvhSfxGvPQznfGCMsST3UFn_Bng2Uz87CUY_7diZ8nyTASlDtt0L
 cb3pP6a4kltBdci3hc.N7LC789WwJ6kVj8PrGrZOvz63.WdpLm2ISiceZ_mD
 Lp.wN448Ct20TDCLmId50aRkAYmXavzqS1ER1g0lyrWB0Gs4Cw4YNXm716Xo
 I0UJgZkCrah2vBpOKxFCttOlGVlCSW8TTOlqUE6aALpeiXSdNuQ5VJUClYeP
 Seb5bfHNoOlBGmdByXn30lRt7x.o_jYydIlWbdiCqqFX97mfYZ.3neCaNWt9
 618xzKb59ANBJaH1u1tbF1i347A9z0QQgb0_qpXPlr1yBasfsMG2cqXvmLFm
 aPzYJvC6rujQsqC44luODe8id1dhoX_vrS7lWZ8EGwBLHop.sXQo9avhK2Ya
 wC0bZvsz3ExKUcGTbEeCWnmkswCvBihxKXlqkvRUV_CZvF.AO.o3fS9TLkQq
 MN2rFQRfPis3TWtq3Qcay3UZ_oaqAuBE-
X-Yahoo-SMTP: 9Tlp3zGswBAMIZY7LhANokCU9rJ2SQ--
To: bug-libtool@HIDDEN
From: Ray Satiro <raysatiro@HIDDEN>
Subject: lt wrapper script puts the .libs rpath last instead of first
Message-ID: <bc90eda5-ae01-f51a-6600-321a5d590605@HIDDEN>
Date: Wed, 24 Aug 2016 01:31:44 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.3 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 24 Aug 2016 01:36:20 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

I am building a shared library and a program that uses it and I need to 
run it uninstalled. libtool creates a lt- version of the program with an 
rpath to the uninstalled shared library, but the problem is I also set 
rpaths and libtool puts its rpath after mine instead of before.

I build curl in Ubuntu similar to this:

LDFLAGS="-Wl,-rpath,/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib" 
./configure [OPTIONS REMOVED FOR BREVITY]
make

I end up with

lib/.libs/libcurl.so
src/curl    <--- libtool wrapper script
src/.libs/lt-curl

When I run src/curl it execs lt-curl which has an rpath for 
/usr/local/lib before lib/.libs, and so it loads the libcurl.so from 
/usr/local/lib. Reviewing the wrapper script I can see libtool appends 
its rpath instead of putting it first. relink-command looks basically 
like this:

gcc -O2 -Wno-system-headers -Wl,-rpath -Wl,/usr/local/ssl/lib -Wl,-rpath 
-Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -o \$progdir/\$file 
[OBJECTS REMOVED FOR BREVITY] -L/usr/local/ssl/lib -L/usr/local/lib 
../lib/.libs/libcurl.so -lssl -lcrypto -lz -Wl,-rpath 
-Wl,/home/owner/curl-7.50.1/lib/.libs

I initially reported this to the cURL project, which I am a part of. The 
bug is https://github.com/curl/curl/issues/432 but I couldn't figure it out.

I attempted to work around this problem when I know src/curl is used by 
using LD_PRELOAD, like

LD_PRELOAD=$PWD/lib/.libs/libcurl.so make test

Recently though I realized a bunch of our tests are overriding 
LD_PRELOAD, and I don't have a work around for those cases at the moment.

I believe appending the lib/.libs rpath instead of prepending it could 
be a bug in libtool.

libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1
Ubuntu 16 LTS
4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 
x86_64 x86_64 GNU/Linux





Acknowledgement sent to Ray Satiro <raysatiro@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to bug-libtool@HIDDEN:
bug#24296; Package libtool. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.