1

I am trying to build a .deb package for an application my company (and me) have been developing. I'm trying to create a 64bit package on my 32bit ubuntu (12.04 LTS) using dpkg-buildpackage and I get the following warnings/errors:

dpkg-shlibdeps: warning/error: couldn't find library X needed by Y.so (ELF format: 'elf64-x86-64'; RPATH: 'some/path/that/does/not/exist')

When X is one of our compiled shared libraries, we get a warning. When it's a system library (like libgcc_s.so.1 and libstdc++.so.6) we get an error.

Why is the RPATH refers to a path that does not exist?

By the way, when I make a 32bit package (on our files that were compiled for 32bit of course) it only shows warnings (only about our proprietary .so files) but creates the .deb file.

If I could, I would have posted my debian folder content but I cant take files out of our network. I can type the relevant parts if its needed.

Braiam
  • 1
  • 11
  • 47
  • 78
Andy Thomas
  • 1,219
  • 3
  • 19
  • 33

2 Answers2

1

You need to install the 64-bits version of the library with apt-get (actually anything do, but this is the most easy):

sudo apt-get install libyouneed-dev:amd64

The trick here is the :amd64, which tells the package manager to install the 64-bit version of that package. The same applies for 32-bits libraries in 64-bit systems. It's called multiarch.

The package is looking at that path because that is where the libraries of 64-bits (or 32-bits) gets stored, but since you don't have it installed the path do not exist.

Braiam
  • 1
  • 11
  • 47
  • 78
  • Okay, I installed `lib64stdc++6` and it solved most of the problems but it still cant find `libpython2.7.so.1.0` (RPATH: ''). Any idea how to solve it? – Andy Thomas Dec 18 '13 at 06:37
  • And why do I get so many warning about our proprietary shared libraries (seems like RPATH shows a wrong path - the path of the compilation, not in the distribution)? – Andy Thomas Dec 18 '13 at 06:53
  • `libpython2.7` has it. – Braiam Dec 18 '13 at 11:29
  • Check http://packages.ubuntu.com/saucy/i386/libpython2.7/filelist and http://packages.ubuntu.com/saucy/amd64/libpython2.7/filelist for the path. Unless you want the development libraries in which case is `-dev`. – Braiam Dec 18 '13 at 12:02
  • I'm not sure what I suppose to do with these links. Can you explain please? I think that the problem is that `RPATH` is empty. When I do `locate libpython2.7.so.1.0` I do find it in `/usr/lib` – Andy Thomas Dec 18 '13 at 12:27
  • @AndyThomas I do not have the sightless idea what could be wrong *now*. You asked me what package has `libpython2.7.so.1.0` in the comments, I answered you. The original question which I answered is all I know, and without more information in which case would merited another different question. – Braiam Dec 18 '13 at 12:41
  • Okay, our internal apt-get server was out of date. Now I have the last version of libpython2.7 installed and the files are installed as specified in your first link, but it still gives me the same error. – Andy Thomas Dec 18 '13 at 13:02
  • Please, ask another question. I don't have an idea of what could be wrong now. I just answered your first questions which is: *Building a 64bit Debian package on 32bit Ubuntu*. Also, please notice that sometimes Ubuntu packages aren't the same as Debians. – Braiam Dec 18 '13 at 13:04
1

Install an amd64 chroot environment and build your package in there. This way you avoid the various multi-arch pitfalls, with the added benefit of having a clean, reproducible build.

There is a tool that makes this very easy: mk-sbuild.

You need to install ubuntu-dev-tools and sbuild.

Then, run mk-sbuild --arch=amd64 precise, which will setup the build environment for you.

Add yourself to the sbuild group: adduser <your user name> sbuild

Log out and log back in so your group membership will be reflected.

You can then build your package in the chroot:

 sbuild -d precise --arch=amd64 name_of_package.dsc

This assumes you've already build the source package with debuild -S or similar.

Sigi
  • 1,784
  • 13
  • 19