From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: How should I install non-guix software? Date: Tue, 07 Aug 2018 19:11:31 +0200 Message-ID: <87y3dije4c.fsf@gmail.com> References: <20180804214540.497af879@gmail.com> <871sbde7va.fsf@gmail.com> <87ftztb360.fsf@gmail.com> <878t5itcfd.fsf@jnanam.net> <20180807154251.a3rbvfenyhksomjd@abyayala> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fn5WD-0004gr-PV for help-guix@gnu.org; Tue, 07 Aug 2018 13:11:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fn5WB-0002Uc-3m for help-guix@gnu.org; Tue, 07 Aug 2018 13:11:37 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fn5WA-0002Ti-PZ for help-guix@gnu.org; Tue, 07 Aug 2018 13:11:34 -0400 Received: by mail-wm0-x22c.google.com with SMTP id w24-v6so18897369wmc.1 for ; Tue, 07 Aug 2018 10:11:34 -0700 (PDT) In-reply-to: <20180807154251.a3rbvfenyhksomjd@abyayala> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Nils Gillmann Cc: help-guix@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Indeed. Foreign binaries must be patched to modify the interpreter (i.e. the dynamic library loader, also known as ld-linux) and the RPATH (the library path). $ patchelf --print-interpreter /bin/sh /gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-glibc-2.27/lib/ld-linux-x86-64.= so.2 $ patchelf --set-interpreter /gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-gl= ibc-2.27/lib/ld-linux-x86-64.so.2 /path/to/foo/bin You can then check the libraries with ldd: $ ldd /path/to/foo/bin linux-vdso.so.1 (0x00007ffefb6e4000) libreadline.so.7 =3D> /gnu/store/s5qvyb3lp0b12qmgiwj3754an7dr1r0s-readline= -7.0.3/lib/libreadline.so.7 (0x00007f0b638f7000) libhistory.so.7 =3D> /gnu/store/s5qvyb3lp0b12qmgiwj3754an7dr1r0s-readline-= 7.0.3/lib/libhistory.so.7 (0x00007f0b636ed000) libncursesw.so.6 =3D> /gnu/store/s9gbq6q72w9vf7zjm0amjf1iw1fy856h-ncurses-= 6.1/lib/libncursesw.so.6 (0x00007f0b6347e000) libdl.so.2 =3D> /gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-glibc-2.27/lib= /libdl.so.2 (0x00007f0b6327a000) libgcc_s.so.1 =3D> /gnu/store/vla5j7pbkpcp39lsdfsmz7m9azn48lr4-gcc-5.5.0-l= ib/lib/libgcc_s.so.1 (0x00007f0b63063000) libc.so.6 =3D> /gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-glibc-2.27/lib/= libc.so.6 (0x00007f0b62cb0000) libbgdrtm.so =3D> not found In this example, one library is missing. If you check the RPATH, you can s= ee the list of folders that are search for libraries: $ patchelf --print-rpath /path/to/foo/bin /gnu/store/s5qvyb3lp0b12qmgiwj3754an7dr1r0s-readline-7.0.3/lib:/gnu/store/s= 9gbq6q72w9vf7zjm0amjf1iw1fy856h-ncurses-6.1/lib:/gnu/store/l4lr0f5cjd0nbsaa= f8b5dmcw1a1yypr3-glibc-2.27/lib:/gnu/store/vla5j7pbkpcp39lsdfsmz7m9azn48lr4= -gcc-5.5.0-lib/lib:/gnu/store/vla5j7pbkpcp39lsdfsmz7m9azn48lr4-gcc-5.5.0-li= b/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../.. You can extend the RPATH to include the missing library: $ patchelf --set-rpath /path/to/missing/lib /path/to/foo/bin And it should work! Hope that helps! =2D-=20 Pierre Neidhardt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAltp0sMACgkQm9z0l6S7 zH/aGwgApWrpCH8z4mmw7C5Z8uKK0J+dwhnY1gox4alCP28y/++bw1G2+cqoYDOy vzOZWudIo/Bd74tkAMzAsf4z/XcpYriREeKhTQlxKc4yQm6aK2Ao/5+tSJnWvEX5 EAS7HnKL7VCJQ4RkM4eXE8+5HHazvt98fTFNmVaWc4ppEMSZejUAjDVzRq+npdAS kNfc8amIAgTvsWE0E9tDc6F37aECIkCg/P7dnHyHO+HC7pp94saca/U2+urPmyvi KoRkpZvfkNRTREHsmVe8GmdeIOedVHKH8ERKdE+pWHHl2cxlq43paIg8+MnPpHo3 Oa5h5tfJCbf7JRMvjRghhQuGcWxniA== =rA+l -----END PGP SIGNATURE----- --=-=-=--