Debian Bug report logs - #484277
use arch specific dlsearch_path config to remove rpath.

version graph

Package: dpkg-cross; Maintainer for dpkg-cross is Debian Embedded Group <debian-embedded@lists.debian.org>; Source for dpkg-cross is src:dpkg-cross.

Reported by: Neil Williams <codehelp@debian.org>

Date: Tue, 3 Jun 2008 11:51:09 UTC

Severity: important

Found in version dpkg-cross/2.5.2

Fixed in version dpkg-cross/2.5.3

Done: Neil Williams <codehelp@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report stored:
Bug#484277; Package general. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
New Bug report received and filed, but not forwarded. Full text and rfc822 format available.

Message #5 received at quiet@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Debian Bug Tracking System <quiet@bugs.debian.org>
Subject: buildd.emdebian.org: RPATH issues
Date: Tue, 03 Jun 2008 12:50:04 +0100
[Message part 1 (text/plain, inline)]
Package: general
Severity: important
User: codehelp@debian.org
Usertags: buildd.emdebian.org

$ lintian -X em qof_0.7.5-1em1_arm.changes
W: libqof1: binary-or-shlib-defines-rpath ./usr/lib/libqof.so.1.0.10
/usr/arm-linux-gnu/lib
W: libqof1: binary-or-shlib-defines-rpath ./usr/lib/libqofsql.so.1.0.1
/usr/arm-linux-gnu/lib

$ lintian -X em qof_0.7.5-1_amd64.changes

# ls /usr/arm*
ls: /usr/arm*: No such file or directory

So the RPATH issue being fixed in Debian seems to be persisting in the
cross-built packages. The actual RPATH does not exist so this may or may
not be a problem.

http://wiki.debian.org/RpathIssue


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

[signature.asc (application/pgp-signature, inline)]

Bug reassigned from package `general' to `emdebian-tools'. Request was from Holger Levsen <holger@layer-acht.org> to control@bugs.debian.org. (Mon, 25 Aug 2008 11:15:13 GMT) Full text and rfc822 format available.

Bug reassigned from package `emdebian-tools' to `buildd.emdebian.org'. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Wed, 03 Sep 2008 06:36:05 GMT) Full text and rfc822 format available.

Blocking bugs of 484277 added: 367115 Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 25 Jun 2009 22:42:15 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Team <debian-embedded@lists.debian.org>:
Bug#484277; Package buildd.emdebian.org. (Fri, 26 Jun 2009 13:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Team <debian-embedded@lists.debian.org>. (Fri, 26 Jun 2009 13:51:04 GMT) Full text and rfc822 format available.

Message #16 received at 484277@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 367115@bugs.debian.org
Cc: 484277@bugs.debian.org
Subject: Problem appears to be sys_lib_dlsearch_path_spec
Date: Fri, 26 Jun 2009 14:45:24 +0100
[Message part 1 (text/plain, inline)]
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=367115#10

/usr/$arch/lib is already set in sys_lib_search_path_spec via the
cross-compiler and --print-search-dirs, however, rpath persists.

After a little investigation with the Emdebian Crush builds, I got this
summary of the problems:

http://wiki.debian.org/EmdebianAuditRpath

I've only tested changes in a few packages but one thing that is
promising is adding the /usr/$arch/lib path to
sys_lib_dlsearch_path_spec as well as the existing setting in
sys_lib_search_path_spec causes libtool (and therefore make) to omit
any call to rpath when relinking the binary at the build stage. Doing
this via the cross-compiler will allow more arbitrary rpaths to be
allowed for useful purposes in upstream development.

Are there likely side-effects from this change?

The difference is that sys_lib_search_path_spec has abspath support to
handle the long-winded way that arm-linux-gnueabi-gcc outputs the
search directories:

libraries:
=/usr/lib/gcc/arm-linux-gnueabi/4.3.3/:/usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../../arm-linux-gnueabi/lib/arm-linux-gnueabi/4.3.3/:/usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../../arm-linux-gnueabi/lib/

That last one resolves to the /usr/$arch/lib/

$ realpath /usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../../arm-linux-gnueabi/lib/
/usr/arm-linux-gnueabi/lib

For dlsearch to gain the same listing, it will also need abspath support.

The problems appear to show up in packages that build against libraries
other than plain libc6 - simple packages that have no other build-dependencies only show an rpath to /usr/lib in the build log which libtool then removes. I think we need the same behaviour for /usr/$arch/lib.

(Note, this does need to come from --print-search-dirs output of the cross-compiler as these paths are not fixed and may change in future.)

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Team <debian-embedded@lists.debian.org>:
Bug#484277; Package buildd.emdebian.org. (Sun, 28 Jun 2009 11:36:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Team <debian-embedded@lists.debian.org>. (Sun, 28 Jun 2009 11:36:06 GMT) Full text and rfc822 format available.

Message #21 received at 484277@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 484277@bugs.debian.org
Cc: 367115@bugs.debian.org
Subject: Possible fix
Date: Sun, 28 Jun 2009 12:33:34 +0100
[Message part 1 (text/plain, inline)]
Autotools and dpkg-cross could provide a simple fix:

lt_cv_sys_lib_dlsearch_path_spec="/usr/$(DEB_HOST_GNU_TYPE)/lib /lib /usr/lib /usr/local/lib"

The default path (on amd64) is:
libtool:sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
"

So it looks like libtool is reading BUILD when it should be reading
HOST.

Now we can either fix this in dpkg-cross by setting
lt_cv_sys_lib_dlsearch_path_spec in the /etc/dpkg-cross/config* files
and hopefully we can fix this in libtool too.

dpkg-cross gives us a direct fix for current builds (i.e. without
regenerating the autotools data of a particular package) and a fix in
libtool gives us a long term fix.

It looks like the libtool macros are listening to the wrong environment
variables - BUILD (which doesn't change when cross-compiling) compared
to HOST (which does change and this change should affect libtool
generation from ./configure).

This change to a CDBS package removes the RPATH from the cross-built
binary packages:

DEB_CONFIGURE_EXTRA_FLAGS=lt_cv_sys_lib_dlsearch_path_spec="/usr/$(DEB_HOST_GNU_TYPE)/lib /lib /usr/lib /usr/local/lib"

By using HOST, it does not change the value from what would be
automatically generated in a native build.

Whether the *order* of the variables matters, I don't know. More
testing required but I'm thinking of putting this into dpkg-cross to
support such tests.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Bug reassigned from package `buildd.emdebian.org' to `dpkg-cross'. Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Mon, 29 Jun 2009 20:18:13 GMT) Full text and rfc822 format available.

Bug marked as found in version 2.5.3. Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Mon, 29 Jun 2009 20:18:14 GMT) Full text and rfc822 format available.

Changed Bug title to `nuse arch specific dlsearch_path config to remove rpath.' from `buildd.emdebian.org: RPATH issues'. Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Mon, 29 Jun 2009 20:18:14 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#484277; Package dpkg-cross. (Mon, 29 Jun 2009 20:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Mon, 29 Jun 2009 20:39:02 GMT) Full text and rfc822 format available.

Message #32 received at 484277@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 484277@bugs.debian.org
Cc: control@bugs.debian.org
Subject: detail
Date: Mon, 29 Jun 2009 21:29:01 +0100
[Message part 1 (text/plain, inline)]
retitle 484277 use arch specific dlsearch_path config to remove rpath.
thanks

Currently testing adding this kind of variable into the dpkg-cross
config files:

# override libtool until #367115 is fixed
hostarch=`dpkg-architecture -qDEB_HOST_GNU_TYPE`
lt_cv_sys_lib_dlsearch_path_spec="/usr/$hostarch/lib /lib /usr/lib /usr/local/lib"

$ cat test.sh 
#!/bin/sh

. cross-config.cache

echo $lt_cv_sys_lib_dlsearch_path_spec

$ sh test.sh 
/usr/x86_64-linux-gnu/lib /lib /usr/lib /usr/local/lib

$ dpkg-architecture -aarmel -c "sh test.sh " 2>/dev/null
/usr/arm-linux-gnueabi/lib /lib /usr/lib /usr/local/lib


-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Changed Bug title to `use arch specific dlsearch_path config to remove rpath.' from `nuse arch specific dlsearch_path config to remove rpath.'. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Mon, 29 Jun 2009 20:39:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#484277; Package dpkg-cross. (Mon, 29 Jun 2009 20:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kallol Biswas <kallolbiswas@yahoo.com>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Mon, 29 Jun 2009 20:45:05 GMT) Full text and rfc822 format available.

Message #39 received at 484277@bugs.debian.org (full text, mbox):

From: Kallol Biswas <kallolbiswas@yahoo.com>
To: Neil Williams <codehelp@debian.org>, 484277@bugs.debian.org
Subject: Re: Bug#484277: detail
Date: Mon, 29 Jun 2009 13:43:06 -0700 (PDT)
How can I unsubscribe from the list?

--- On Mon, 6/29/09, Neil Williams <codehelp@debian.org> wrote:

> From: Neil Williams <codehelp@debian.org>
> Subject: Bug#484277: detail
> To: 484277@bugs.debian.org
> Cc: control@bugs.debian.org
> Date: Monday, June 29, 2009, 1:29 PM
> retitle 484277 use arch specific
> dlsearch_path config to remove rpath.
> thanks
> 
> Currently testing adding this kind of variable into the
> dpkg-cross
> config files:
> 
> # override libtool until #367115 is fixed
> hostarch=`dpkg-architecture -qDEB_HOST_GNU_TYPE`
> lt_cv_sys_lib_dlsearch_path_spec="/usr/$hostarch/lib /lib
> /usr/lib /usr/local/lib"
> 
> $ cat test.sh 
> #!/bin/sh
> 
> . cross-config.cache
> 
> echo $lt_cv_sys_lib_dlsearch_path_spec
> 
> $ sh test.sh 
> /usr/x86_64-linux-gnu/lib /lib /usr/lib /usr/local/lib
> 
> $ dpkg-architecture -aarmel -c "sh test.sh "
> 2>/dev/null
> /usr/arm-linux-gnueabi/lib /lib /usr/lib /usr/local/lib
> 
> 
> -- 
> 
> 
> Neil Williams
> =============
> http://www.data-freedom.org/
> http://www.linux.codehelp.co.uk/
> http://e-mail.is-not-s.ms/
> 
> 




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#484277; Package dpkg-cross. (Mon, 29 Jun 2009 22:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Mon, 29 Jun 2009 22:45:03 GMT) Full text and rfc822 format available.

Message #44 received at 484277@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 484277@bugs.debian.org
Subject: Re: Bug#484277: remaining issues
Date: Mon, 29 Jun 2009 23:44:17 +0100
[Message part 1 (text/plain, inline)]
On Mon, 29 Jun 2009 21:29:01 +0100
Neil Williams <codehelp@debian.org> wrote:

> Currently testing adding this kind of variable into the dpkg-cross
> config files:
> 
> # override libtool until #367115 is fixed
> hostarch=`dpkg-architecture -qDEB_HOST_GNU_TYPE`
> lt_cv_sys_lib_dlsearch_path_spec="/usr/$hostarch/lib /lib /usr/lib /usr/local/lib"


Sadly, for this to work, some older packages need to have the autotools
and libtoolize refreshed. This means cleaning a range of files:

missing config.guess config.sub ltmain.sh install-sh depcomp

and then running 'autoreconf -ifs' at an appropriately early stage in
debian/rules.

With a refreshed autotools setup, the dpkg-cross addition is correctly
picked up and the rpath is not set.

e.g. for a CDBS package:

+
+clean::
+       $(RM) missing config.guess config.sub ltmain.sh install-sh depcomp
+
+makebuilddir::
+       autoreconf -ifs
+

It is not possible to embed these rules into emdebuild because
dpkg-buildpackage will complain if the relevant files are not in the
clean rule.

Running autoreconf is not without side-effects and some packages will
refuse to build properly if it is run from debian/rules.

The real fix remains #367115

Testing continues.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Blocking bugs of 484277 removed: 367115 Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 02 Jul 2009 10:36:17 GMT) Full text and rfc822 format available.

Tags added: pending Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 02 Jul 2009 10:36:19 GMT) Full text and rfc822 format available.

Blocking bugs of 484277 removed: 367115 Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 02 Jul 2009 10:36:20 GMT) Full text and rfc822 format available.

Tags added: pending Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 02 Jul 2009 10:36:21 GMT) Full text and rfc822 format available.

Bug no longer marked as found in version 2.5.3. Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 02 Jul 2009 10:54:02 GMT) Full text and rfc822 format available.

Bug marked as found in version 2.5.2. Request was from "Neil Williams" <neil@codehelp.co.uk> to control@bugs.debian.org. (Thu, 02 Jul 2009 10:54:03 GMT) Full text and rfc822 format available.

Reply sent to Neil Williams <codehelp@debian.org>:
You have taken responsibility. (Thu, 02 Jul 2009 12:24:03 GMT) Full text and rfc822 format available.

Notification sent to Neil Williams <codehelp@debian.org>:
Bug acknowledged by developer. (Thu, 02 Jul 2009 12:24:03 GMT) Full text and rfc822 format available.

Message #61 received at 484277-close@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 484277-close@bugs.debian.org
Subject: Bug#484277: fixed in dpkg-cross 2.5.3
Date: Thu, 02 Jul 2009 12:02:04 +0000
Source: dpkg-cross
Source-Version: 2.5.3

We believe that the bug you reported is fixed in the latest version of
dpkg-cross, which is due to be installed in the Debian FTP archive:

dpkg-cross_2.5.3.dsc
  to pool/main/d/dpkg-cross/dpkg-cross_2.5.3.dsc
dpkg-cross_2.5.3.tar.gz
  to pool/main/d/dpkg-cross/dpkg-cross_2.5.3.tar.gz
dpkg-cross_2.5.3_all.deb
  to pool/main/d/dpkg-cross/dpkg-cross_2.5.3_all.deb
libdebian-dpkgcross-perl_2.5.3_all.deb
  to pool/main/d/dpkg-cross/libdebian-dpkgcross-perl_2.5.3_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 484277@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Neil Williams <codehelp@debian.org> (supplier of updated dpkg-cross package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 02 Jul 2009 12:11:59 +0100
Source: dpkg-cross
Binary: dpkg-cross libdebian-dpkgcross-perl
Architecture: source all
Version: 2.5.3
Distribution: unstable
Urgency: low
Maintainer: Debian Embedded Group <debian-embedded@lists.debian.org>
Changed-By: Neil Williams <codehelp@debian.org>
Description: 
 dpkg-cross - tools for cross compiling Debian packages
 libdebian-dpkgcross-perl - functions to aid cross-compiling Debian packages
Closes: 484277
Changes: 
 dpkg-cross (2.5.3) unstable; urgency=low
 .
   * Retain font metadata in /usr/share/fonts for xfonts-utils.
   * Add arch specific dlsearch_path config to remove rpath.
     (Closes: #484277)
Checksums-Sha1: 
 fef568e5ea99631b4bb09caa5ebe822b96e35188 1208 dpkg-cross_2.5.3.dsc
 0b0c8ac8d8cf2886a2a613da7d3528a7f7493159 69683 dpkg-cross_2.5.3.tar.gz
 52b7a874bef0f6daffbbcdfe1132468176cdc149 50168 dpkg-cross_2.5.3_all.deb
 1dd8cf7d7adb1af03fffb3e1887e19c779050019 28636 libdebian-dpkgcross-perl_2.5.3_all.deb
Checksums-Sha256: 
 437ded5b726d72317ee25f1bad58a62c11d7924c62cf262656cf3b9768421b99 1208 dpkg-cross_2.5.3.dsc
 32f55c45afdbe744afc25c7daa7d174a7c589e9db4ec0a9b867736f2bf0132ef 69683 dpkg-cross_2.5.3.tar.gz
 83f0e10bdefb1a1eb0800c1c93da1c78a42d977f9ca3a3cb43418953612cf748 50168 dpkg-cross_2.5.3_all.deb
 40e7dba81ad2947d3347810ae310216647892c107e43bf039d2519304db2f95b 28636 libdebian-dpkgcross-perl_2.5.3_all.deb
Files: 
 07fb83281f4b9712f21e484da54b2ec6 1208 utils extra dpkg-cross_2.5.3.dsc
 eb089724d8848c734f032d5635796f47 69683 utils extra dpkg-cross_2.5.3.tar.gz
 6a084a78c65f4c749b3a6f50f255b74e 50168 utils extra dpkg-cross_2.5.3_all.deb
 72a10677ef1fd05cd0972ada78e0e3b8 28636 perl extra libdebian-dpkgcross-perl_2.5.3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpMnqEACgkQiAEJSii8s+NQCgCfRfJXHaa322+bS0PGqB4AKVuP
+/EAnRwCbK7iHGMEb4jl7/6IuSwAgwEo
=xXMi
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 10 Aug 2009 07:35:06 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 16:47:39 2014; Machine Name: buxtehude.debian.org

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