From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 68x0O6AIrl7fIQAA0tVLHw (envelope-from ) for ; Sat, 02 May 2020 23:56:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id v92vJKoIrl78DgAA1q6Kng (envelope-from ) for ; Sat, 02 May 2020 23:56:26 +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 9E94C942B0E for ; Sat, 2 May 2020 23:56:14 +0000 (UTC) Received: from localhost ([::1]:36846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jV1zR-0005SF-Dm for larch@yhetil.org; Sat, 02 May 2020 19:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV1zI-0005S0-Lb for bug-guix@gnu.org; Sat, 02 May 2020 19:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jV1zG-00053s-5k for bug-guix@gnu.org; Sat, 02 May 2020 19:56:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jV1zF-00053e-QV for bug-guix@gnu.org; Sat, 02 May 2020 19:56:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jV1zF-0002iC-Pz for bug-guix@gnu.org; Sat, 02 May 2020 19:56:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41038: gcc creates binaries that don't find their shared libraries Resent-From: Bruno Haible Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 02 May 2020 23:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41038 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 41038@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158846371610356 (code B ref -1); Sat, 02 May 2020 23:56:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 May 2020 23:55:16 +0000 Received: from localhost ([127.0.0.1]:54171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jV1yU-0002gu-6v for submit@debbugs.gnu.org; Sat, 02 May 2020 19:55:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:42098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jV1yQ-0002gl-Is for submit@debbugs.gnu.org; Sat, 02 May 2020 19:55:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV1yO-0004Qg-AN for bug-guix@gnu.org; Sat, 02 May 2020 19:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jV1yM-0002Xy-1u for bug-guix@gnu.org; Sat, 02 May 2020 19:55:07 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::5]:31939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV1yL-0002Rv-18 for bug-guix@gnu.org; Sat, 02 May 2020 19:55:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1588463701; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=tdgpaDnznHCZipyGkliQYCaXDDfMLsBplg4rVwGbNaQ=; b=CpL1pYoNKrTL9hJ5a9mT3NesFDOnUq61eg5um5X1Vbk1DFA/Q8kHnduQ0nwVzSCEcg I893Vm6RwOA3RJqiDznpzgQsPCH5bWJz0lU6nVSvdTajyPgA1QC5AU5dGiFayu724p2T gJKu/+HVxSAmcxFzOSU+7QF0xCABTbzN9ZRo56+cK5rJVtBqqs8mrkqVJG0/3qM9rSx2 Q+QQCIhZkNt6iUg2PkWpAGSkq5beO2bJRTL+rCC0h4AXdB7JVa7AW8LG7e51rMjcGaDd kiXBleGJmAUz+qOzYhO3RyDrdqilMXhZ8HEJWTIKWKL7tPBFkmwhDuuQwK1Bs4Z6E00p 6f+g== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.6.2 DYNA|AUTH) with ESMTPSA id j093d3w42Nt1oD4 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 3 May 2020 01:55:01 +0200 (CEST) From: Bruno Haible Date: Sun, 03 May 2020 01:55:00 +0200 Message-ID: <1928431.D5bU72YO8c@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=2a01:238:20a:202:5300::5; envelope-from=bruno@clisp.org; helo=mo6-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: 2.49 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=clisp.org header.s=strato-dkim-0002 header.b=CpL1pYoN; 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 [2.49 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49463080116497]; MX_INVALID(1.00)[cached]; DWL_DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.15), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; RCVD_COUNT_TWELVE(0.00)[12]; TO_DN_NONE(0.00)[]; R_DKIM_REJECT(1.00)[clisp.org:s=strato-dkim-0002]; DKIM_TRACE(0.00)[clisp.org:-]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; CTE_CASE(0.50)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[bruno@clisp.org,bug-guix-bounces@gnu.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[gnu.org:url]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[clisp.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: ukZC1Kc6G77l Hi, I'm using the recent guix-system-vm-image-1.1.0.x86_64-linux. After installing a couple of package for development $ guix install make gcc-toolchain binutils glibc gdb gettext m4 autoconf automake I expected to be able to build GNU bison 3.5.91 from source. But I hit a build failure, due to a program being linked against a shared library that cannot be found. How to reproduce (simple test case): ---------------- $ wget https://ftp.gnu.org/gnu/gettext/gettext-0.20.1.tar.gz $ tar xfz gettext-0.20.1.tar.gz $ cd gettext-0.20.1/libtextstyle/examples/color-hello $ ./autogen.sh $ ./configure ... checking how to link with libtextstyle... -ltextstyle ... $ 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 $ ldd hello ... libtextstyle.so.0 => not found ... Discussion ---------- For packages *installed by the user*, the configure test has code to add -Wl,-rpath,DIR options for appropriate directories. However, here, the library has been installed by the system (through 'guix install gettext'). It appears that gcc, when searching for the library, finds it. Whereas the dynamic loader (ld-linux-x86-64.so.2) apparently does not find it. It should be GCC's job to create binaries that work, when all referenced libraries are system libraries. The ELF file format and dynamic loader have enough facilities to make this possible (-Wl,-rpath option, ld.so.conf, ld.so.cache). Bruno