From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kLiPE/FBr14nLwAA0tVLHw (envelope-from ) for ; Sun, 03 May 2020 22:13:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id LdbQC/xBr15CbQAAbx9fmQ (envelope-from ) for ; Sun, 03 May 2020 22:13:16 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 17F8B941A8A for ; Sun, 3 May 2020 22:13:14 +0000 (UTC) Received: from localhost ([::1]:44442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVMrI-0002Rh-L7 for larch@yhetil.org; Sun, 03 May 2020 18:13:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVMr9-0002RX-4o for bug-guix@gnu.org; Sun, 03 May 2020 18:13:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVMr8-0001yD-Ga for bug-guix@gnu.org; Sun, 03 May 2020 18:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVMr8-0003Tj-9d for bug-guix@gnu.org; Sun, 03 May 2020 18:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41038: gcc creates binaries that don't find their shared libraries Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 03 May 2020 22:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41038 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Bruno Haible Received: via spool by 41038-submit@debbugs.gnu.org id=B41038.158854393513318 (code B ref 41038); Sun, 03 May 2020 22:13:02 +0000 Received: (at 41038) by debbugs.gnu.org; 3 May 2020 22:12:15 +0000 Received: from localhost ([127.0.0.1]:58289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVMqL-0003Sh-Ch for submit@debbugs.gnu.org; Sun, 03 May 2020 18:12:15 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:33456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVMqH-0003SW-00 for 41038@debbugs.gnu.org; Sun, 03 May 2020 18:12:11 -0400 Received: from localhost (80-110-127-207.cgn.dynamic.surfer.at [80.110.127.207]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 71C5833602AF; Mon, 4 May 2020 00:12:07 +0200 (CEST) Date: Mon, 4 May 2020 00:12:03 +0200 From: Danny Milosavljevic Message-ID: <20200504001203.74597aad@scratchpost.org> In-Reply-To: <1928431.D5bU72YO8c@omega> References: <1928431.D5bU72YO8c@omega> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/jTAH_QJA4FEItMNMXpw8n4g"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41038@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: 3.69 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Scan-Result: default: False [3.69 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49386424463802]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2001:470:142::/48:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.14), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[80.110.127.207:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RSPAMD_URIBL(4.50)[clisp.org:email]; FROM_NEQ_ENVFROM(0.00)[dannym@scratchpost.org,bug-guix-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[gnu.org:url,clisp.org:email]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[scratchpost.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; BAD_REP_POLICIES(0.10)[]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: OSoW87CM4mBZ --Sig_/jTAH_QJA4FEItMNMXpw8n4g Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Bruno, On Sun, 03 May 2020 01:55:00 +0200 Bruno Haible wrote: > $ make > ... > gcc -g -O2 -o hello hello.o -ltextstyle > $ ./hello > ./hello: error while loading shared libraries: libtextstyle.so.0: cannot = open shared object file: No such file or directory I remember being tripped up by this when I started using Guix. It is annoy= ing. I wonder if it's possible to instruct gcc (or ld, I guess) to automatically add rpath to where it found the respective library. That's really what we expect to happen in Guix. Ugly workaround: $ wget https://ftp.gnu.org/gnu/gettext/gettext-0.20.1.tar.gz $ tar xfz gettext-0.20.1.tar.gz $ guix install make gcc-toolchain binutils glibc gdb gettext m4 autoconf au= tomake # or better: guix environment --pure --ad-hoc gcc-toolchain make coreutils = binutils glibc gdb gettext m4 autoconf automake sed grep gawk (env)$ cd gettext-0.20.1/libtextstyle/examples/color-hello (env)$ ./autogen.sh (env)$ export LDFLAGS=3D-Wl,-rpath=3D`echo $LIBRARY_PATH | sed -e 's;:; -Wl= ,-rpath=3D;g'`=20 (env)$ ./configure (env)$ make exit $ ./hello Hello But unfortunately, Makefiles are not standardized in how to add linker flags--so it's not easy to find out how to do that in general. The above does work for gettext. --Sig_/jTAH_QJA4FEItMNMXpw8n4g Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl6vQbMACgkQ5xo1VCww uqWIQgf/SK2T4RQbMs739WWdMpu7Q7DSmO0Zy+b0Kvf8VG5OuCYNCB8VfDGwNrhw LCr+vq6Y+JWT45mGvCWjZXASZkdS/ZS8Z7JY+7JaLkHJooZUuKtkDaHEQtp8ppaI us2EspsdeR/b6grGA/zugdW+4cOEb6CMMogeL1ZuTlJJTIWKN6EKD/R790uahk5A wiokNqM7xFXnzS0EGK0I+y0avDiW3nOF8zkOepOLj4fI7pOsNPRBjc/GjZ1ntS+X +ZN5Etc7npTcYRi+Nnxt+87UbXw6hPxiqjuMuKSrOSOdOIvpzt2RrOxQgY6atY/i NXLen8wfWlKcp+DSK9TYc7XmIUsSww== =hBch -----END PGP SIGNATURE----- --Sig_/jTAH_QJA4FEItMNMXpw8n4g--