From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 05:38:29 2024 Received: (at submit) by debbugs.gnu.org; 12 Apr 2024 09:38:30 +0000 Received: from localhost ([127.0.0.1]:57897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvDMT-0003MU-29 for submit@debbugs.gnu.org; Fri, 12 Apr 2024 05:38:29 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvDMP-0003Ki-7C for submit@debbugs.gnu.org; Fri, 12 Apr 2024 05:38:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvDM9-0006LA-E3 for bug-guix@gnu.org; Fri, 12 Apr 2024 05:38:01 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvDM6-0005GN-2v for bug-guix@gnu.org; Fri, 12 Apr 2024 05:38:01 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4VGBKb0pM2z3xD4 for ; Fri, 12 Apr 2024 11:36:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1712914611; bh=odRQauBi3vmWPvINkytt8oNr8lqIb7cqfY/ldt63JlA=; h=Subject:From:To:Date; b=quwKAaWSKSl4cZ4Up//V12VS/LskSlK+dZFQZ4tkv1c6XOKf0rLnzGOuB3aigXjm0 7D6ULdtSZ5le8p8ArlrcZaLH0kGLUvlh81wC+nvuNe5cSYdWq2xjJjbOFM9wGNpb2Y bZPKb6O7spdaV06Z5KZNmm2UqeYHklaR9MmhTNDs= Message-ID: Subject: Clang fails to communicate RUNPATH? From: Liliana Marie Prikler To: bug-guix@gnu.org Date: Fri, 12 Apr 2024 11:36:50 +0200 Content-Type: multipart/mixed; boundary="=-sS+hXT+EVQO+LNJkvJLS" User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: none client-ip=129.27.2.202; envelope-from=liliana.prikler@ist.tugraz.at; helo=mailrelay.tugraz.at X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-sS+hXT+EVQO+LNJkvJLS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Guix, I've noticed a strange error when attempting to build my software against clang-toolchain. I've attached a minimally breaking example, but the gist of it is that RUNPATH validation fails as shown below. starting phase `validate-runpath' validating RUNPATH of 1 binaries in "/gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin"... /gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin/hello: error: depends on 'libfmt.so.9', which cannot be found in RUNPATH =C2=A0("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib") Is this expected? I know that the -for-system have historically disregarded the existence of clang-toolchain and hence led to issues, but I think this is something else=E2=80=A6 Cheers --=-sS+hXT+EVQO+LNJkvJLS Content-Disposition: attachment; filename="why-hello.scm" Content-Type: text/x-scheme; name="why-hello.scm"; charset="UTF-8" Content-Transfer-Encoding: base64 KHVzZS1tb2R1bGVzIChnbnUgcGFja2FnZXMgcHJldHR5LXByaW50KQogICAgICAgICAgICAgKGdu dSBwYWNrYWdlcyBwa2ctY29uZmlnKQogICAgICAgICAgICAgKGd1aXggcGFja2FnZXMpCiAgICAg ICAgICAgICAoZ3VpeCBnZXhwKQogICAgICAgICAgICAgKGd1aXggdHJhbnNmb3JtYXRpb25zKQog ICAgICAgICAgICAgKGd1aXggYnVpbGQtc3lzdGVtIG1lc29uKQogICAgICAgICAgICAgKChndWl4 IGxpY2Vuc2VzKSAjOnNlbGVjdCAoZ3BsMyspKQogICAgICAgICAgICAgKChndWl4IGdpdC1kb3du bG9hZCkgIzpzZWxlY3QgKGdpdC1maWxlLW5hbWUpKQogICAgICAgICAgICAgKHNyZmkgc3JmaS0y NikpCgooZGVmaW5lIHdoeS1oZWxsbwogIChwYWNrYWdlCiAgIChuYW1lICJ3aHktaGVsbG8iKQog ICAodmVyc2lvbiAiMCIpCiAgIChzb3VyY2UgKGZpbGUtdW5pb24gKGdpdC1maWxlLW5hbWUgbmFt ZSB2ZXJzaW9uKQogICAgICAgICAgICBgKCgiaGVsbG8uY3BwIiAsKHBsYWluLWZpbGUgImhlbGxv LmNwcCIKICAgICAgICAgICAgICAgICAgICAgICAiXAojaW5jbHVkZSA8Zm10L2Zvcm1hdC5oPgoK aW50Cm1haW4oKQp7CiAgZm10OjpwcmludCAoXCJ7fVxcblwiLCBcIkhlbGxvLCB3b3JsZFwiKTsK ICByZXR1cm4gMDsKfQoiKSkKICAgICAgICAgICAgICAoIm1lc29uLmJ1aWxkIiAsKHBsYWluLWZp bGUgIm1lc29uLmJ1aWxkIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAiXApwcm9qZWN0KCdoZWxsbycsICdjcHAnLCBkZWZhdWx0X29wdGlvbnM6IFsnY3BwX3N0ZD1j KysyMCddKQpleGVjdXRhYmxlKCdoZWxsbycsIGZpbGVzKCdoZWxsby5jcHAnKSwgaW5zdGFsbDog dHJ1ZSwKICAgICAgICAgICBkZXBlbmRlbmNpZXM6IFtkZXBlbmRlbmN5KCdmbXQnKV0pCiIpKSkp KQogICAoYnVpbGQtc3lzdGVtIG1lc29uLWJ1aWxkLXN5c3RlbSkKICAgKGlucHV0cyAobGlzdCBm bXQpKQogICAobmF0aXZlLWlucHV0cyAobGlzdCBwa2ctY29uZmlnKSkKICAgKGhvbWUtcGFnZSAo YW5kPT4gKGN1cnJlbnQtZmlsZW5hbWUpCiAgICAgICAgICAgICAgICAgICAgIChjdXRlIHN0cmlu Zy1hcHBlbmQgImZpbGU6Ly8iIDw+KSkpCiAgIChzeW5vcHNpcyAiSGVsbG8gd29ybGQiKQogICAo ZGVzY3JpcHRpb24gIlRoaXMgcGFja2FnZSBwcm92aWRlcyBhIHNpbXBsZSBwcm9ncmFtIHRoYXQg YnVpbGRzIHdpdGgKR0NDL0crKyBub3JtYWxseSwgYnV0IGZhaWxzIG1pc2VyYWJseSB3aGVuIHRo ZSBjbGFuZy10b29sY2hhaW4gaXMgdXNlZC4iKQogICAobGljZW5zZSBncGwzKykpKQoKKGRlZmlu ZSB3aHktaGVsbG8tY2xhbmcKICAoKG9wdGlvbnMtPnRyYW5zZm9ybWF0aW9uCiAgICAnKCh3aXRo LWMtdG9vbGNoYWluIC4gIndoeS1oZWxsbz1jbGFuZy10b29sY2hhaW4iKSkpCiAgIHdoeS1oZWxs bykpCgp3aHktaGVsbG8tY2xhbmcK --=-sS+hXT+EVQO+LNJkvJLS-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 25 05:27:05 2024 Received: (at 70349) by debbugs.gnu.org; 25 May 2024 09:27:05 +0000 Received: from localhost ([127.0.0.1]:42325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAng8-000508-IH for submit@debbugs.gnu.org; Sat, 25 May 2024 05:27:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAng5-0004zg-Mi for 70349@debbugs.gnu.org; Sat, 25 May 2024 05:27:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAnfq-0002mP-Bl; Sat, 25 May 2024 05:26:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=G9KgrwHD+0EeV/T1/2Fr2IwMgyifrqq3hNWi7FNOkAk=; b=artPway1WapndFfSeQTj wJrJWvcZDhAXdtlSNYXhdAyE2Tuv/8jbB9/6usY+ExTpZ5M6KKwzj1pg1Vu+kcwCIr2fYdKaYcK+d wAgxsCDYVywTJqFzrGOJ2tONOs2UNJf3Ybh1+Ex2ExWw4J6pghM+zUqnXaA699WGilZIknd3KMbz4 XPnprLjNMMqFSfs9ZlGHLTTTM0f0v0Mrc8l4TO9E6e9+fAdNgRI9HKP5noY7C+Atq0WlWFVRYbtkd t/xJH3ASPYZe/ub1qpKVZYjpD3pf8+b6mcGxzmNWxpyPwHzE+a+jB7nPJdGNuh2L+cLlAlCNfoU0K NOLADovRrgl0vQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Liliana Marie Prikler Subject: Re: bug#70349: Clang fails to communicate RUNPATH? In-Reply-To: (Liliana Marie Prikler's message of "Fri, 12 Apr 2024 11:36:50 +0200") References: Date: Sat, 25 May 2024 11:26:42 +0200 Message-ID: <87zfse2qel.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70349 Cc: 70349@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Liliana, Liliana Marie Prikler skribis: > I've noticed a strange error when attempting to build my software > against clang-toolchain. I've attached a minimally breaking example, > but the gist of it is that RUNPATH validation fails as shown below. > > starting phase `validate-runpath' > validating RUNPATH of 1 binaries in > "/gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin"... > /gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin/hello: > error: depends on 'libfmt.so.9', which cannot be found in RUNPATH > =C2=A0("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib") > > Is this expected? I know that the -for-system have historically > disregarded the existence of clang-toolchain and hence led to issues, > but I think this is something else=E2=80=A6 Could this be an issue specific to =E2=80=98meson-build-system=E2=80=99? For instance, this works fine (both mpfr and mpc use =E2=80=98gnu-build-system=E2=80=99): guix build mpc --with-c-toolchain=3Dmpfr=3Dclang-toolchain If we add this to the example you posted: (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'debug-ld-wrapper (lambda _ (setenv "GUIX_LD_WRAPPER_DEBUG" "yes")))))) =E2=80=A6 we see: --8<---------------cut here---------------start------------->8--- ld-wrapper: library search path: ("/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpc= wgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0" "/gnu/store/gsj= czqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "/gnu/store/l684qgqlrqkbsh8jf= fp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../.= ./.." "/gnu/store/inpy5mz35fwvclynpag5gsp6d1hflfsz-meson-1.1.0/lib" "/gnu/s= tore/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "/gnu/store/j8wlfmlmfv= pbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib" "/gnu/store/gr0sy0m1mv36qv54idm6cn1= 0l3mngshq-file-5.44/lib" "/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-= 5.2.1/lib" "/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib" "/gnu= /store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib" "/gnu/= store/0irvg0gvvfwagdjckigvr4g8xap94y1j-clang-toolchain-18.1.5/lib") ld-wrapper: libraries linked: ("/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0= -fmt-9.1.0/lib/libfmt.so" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-= 11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libstdc++.so" "= /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libm.so" "/gnu/s= tore/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown= -linux-gnu/11.3.0/../../../libgcc_s.so" "/gnu/store/gsjczqir1wbz8p770zndrpw= 4rnppmxi3-glibc-2.35/lib/libc.so" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpc= wgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libgcc_= s.so") ld-wrapper: invoking `/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-= 2.38/bin/ld' with ("--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-link= er" "//gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/ld-linux-x= 86-64.so.2" "-o" "hello" "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc= -2.35/lib/Scrt1.o" "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/= lib/crti.o" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib= /gcc/x86_64-unknown-linux-gnu/11.3.0/crtbeginS.o" "-L/gnu/store/l684qgqlrqk= bsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.= 0" "-L/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "-L/gnu/s= tore/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown= -linux-gnu/11.3.0/../../.." "-L/gnu/store/inpy5mz35fwvclynpag5gsp6d1hflfsz-= meson-1.1.0/lib" "-L/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/l= ib" "-L/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib" "-L/gnu= /store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib" "-L/gnu/store/hc05d7= 6f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib" "-L/gnu/store/6k1yys9wqrfn4y41ic= 1win8gpnimncwj-xz-5.2.8/lib" "-L/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a= -glibc-utf8-locales-2.35/lib" "-L/gnu/store/0irvg0gvvfwagdjckigvr4g8xap94y1= j-clang-toolchain-18.1.5/lib" "hello.p/hello.cpp.o" "--as-needed" "--no-und= efined" "-rpath=3D/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/l= ib" "-rpath" "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "-= rpath-link" "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "--= start-group" "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib/lib= fmt.so" "--end-group" "-lstdc++" "-lm" "-lgcc_s" "-lgcc" "-lc" "-lgcc_s" "-= lgcc" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x= 86_64-unknown-linux-gnu/11.3.0/crtendS.o" "/gnu/store/gsjczqir1wbz8p770zndr= pw4rnppmxi3-glibc-2.35/lib/crtn.o" "-rpath" "/gnu/store/qhz8n6mxzalifcrml6f= wsvnxw92bk7n0-fmt-9.1.0/lib" "-rpath" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6= vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.." "-= rpath" "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "-rpath= " "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_6= 4-unknown-linux-gnu/11.3.0/../../.." "-rpath" "/gnu/store/gsjczqir1wbz8p770= zndrpw4rnppmxi3-glibc-2.35/lib" "-rpath" "/gnu/store/l684qgqlrqkbsh8jffp9d8= ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../..") [=E2=80=A6] starting phase `shrink-runpath' /gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin/hello: strippin= g RUNPATH to ("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib")= (removed ("/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/lib" "/= gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-un= known-linux-gnu/11.3.0/../../..")) phase `shrink-runpath' succeeded after 0.0 seconds starting phase `validate-runpath' validating RUNPATH of 1 binaries in "/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd= 8906y-why-hello-0/bin"... /gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin/hello: error: d= epends on 'libfmt.so.9', which cannot be found in RUNPATH ("/gnu/store/gsjc= zqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib") --8<---------------cut here---------------end--------------->8--- So the =E2=80=98ld=E2=80=99 wrapper is indeed passing =E2=80=98-rpath /path= /to/fmt=E2=80=99 but down the road that gets lost. Could it be that Meson removes it when it install files? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 02:49:23 2024 Received: (at 70349) by debbugs.gnu.org; 27 May 2024 06:49:23 +0000 Received: from localhost ([127.0.0.1]:42918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBUAc-0002W2-Kp for submit@debbugs.gnu.org; Mon, 27 May 2024 02:49:23 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:42208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBUAZ-0002Vr-Af for 70349@debbugs.gnu.org; Mon, 27 May 2024 02:49:21 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4VnmTH0FBtz1HNLY; Mon, 27 May 2024 08:49:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4VnmTH0FBtz1HNLY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1716792547; bh=LAYuvW6iJG6+EKW1iXKBYfqKmS0uy+gmJfpxQ8W5ViY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Orc1i3FBCfKYyxzVCu3b0zhrAeaRh4/O7AQ2/CXmtYDiZhe31+dRAn/w0sL+32HcS Ei7YoaDYBjdSNd5Vtq9EFG4S2VWuz7KusmV7CoMQeRTGX0yqlFjrodmLY8gRJ5rkSS GiLFvHwYUdv4WRWsZyPHg1NOwZsEN2MG5rpvWrX0= Message-ID: <19656e53cc00d10f8fd424c9770e7789ce90109a.camel@ist.tugraz.at> Subject: Re: bug#70349: Clang fails to communicate RUNPATH? From: Liliana Marie Prikler To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Mon, 27 May 2024 08:49:06 +0200 In-Reply-To: <87zfse2qel.fsf@gnu.org> References: <87zfse2qel.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70349 Cc: 70349@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Ludo, Am Samstag, dem 25.05.2024 um 11:26 +0200 schrieb Ludovic Court=C3=A8s: > Could this be an issue specific to =E2=80=98meson-build-system=E2=80=99? >=20 > For instance, this works fine (both mpfr and mpc use > =E2=80=98gnu-build-system=E2=80=99): >=20 > =C2=A0 guix build mpc --with-c-toolchain=3Dmpfr=3Dclang-toolchain >=20 > If we add this to the example you posted: >=20 > =C2=A0=C2=A0 (arguments > =C2=A0=C2=A0=C2=A0 (list #:phases #~(modify-phases %standard-phases > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after 'un= pack 'debug-ld-wrapper > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (l= ambda _ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (setenv "GUIX_LD_WRAPPER_DEBUG" > "yes")))))) >=20 > =E2=80=A6 we see: >=20 > --8<---------------cut here---------------start------------->8--- > ld-wrapper: library search path: > ("/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.." > "/gnu/store/inpy5mz35fwvclynpag5gsp6d1hflfsz-meson-1.1.0/lib" > "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" > "/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib" > "/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib" > "/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib" > "/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib" > "/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales- > 2.35/lib" "/gnu/store/0irvg0gvvfwagdjckigvr4g8xap94y1j-clang- > toolchain-18.1.5/lib") > ld-wrapper: libraries linked: > ("/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt- > 9.1.0/lib/libfmt.so" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs- > gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux- > gnu/11.3.0/../../../libstdc++.so" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libm.so" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libgcc_s.so" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libgcc_s.so") > ld-wrapper: invoking `/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m- > binutils-2.38/bin/ld' with ("--eh-frame-hdr" "-m" "elf_x86_64" "-pie" > "-dynamic-linker" "//gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3- > glibc-2.35/lib/ld-linux-x86-64.so.2" "-o" "hello" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/Scrt1.o" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/crti.o" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtbeginS.o" "- > L/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0" "- > L/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "- > L/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.." "- > L/gnu/store/inpy5mz35fwvclynpag5gsp6d1hflfsz-meson-1.1.0/lib" "- > L/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "- > L/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib" "- > L/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib" "- > L/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib" "- > L/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib" "- > L/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales- > 2.35/lib" "-L/gnu/store/0irvg0gvvfwagdjckigvr4g8xap94y1j-clang- > toolchain-18.1.5/lib" "hello.p/hello.cpp.o" "--as-needed" "--no- > undefined" "-rpath=3D/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why- > hello-0/lib" "-rpath" "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0- > fmt-9.1.0/lib" "-rpath-link" > "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "--start- > group" "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt- > 9.1.0/lib/libfmt.so" "--end-group" "-lstdc++" "-lm" "-lgcc_s" "-lgcc" > "-lc" "-lgcc_s" "-lgcc" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs- > gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtendS.o" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/crtn.o" > "-rpath" "/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" > "-rpath" "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.." "-rpath" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "-rpath" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.." "-rpath" > "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "-rpath" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../..") >=20 > [=E2=80=A6] >=20 > starting phase `shrink-runpath' > /gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin/hello: > stripping RUNPATH to ("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3- > glibc-2.35/lib") (removed > ("/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/lib" > "/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0- > lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../..")) > phase `shrink-runpath' succeeded after 0.0 seconds > starting phase `validate-runpath' > validating RUNPATH of 1 binaries in > "/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin"... > /gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin/hello: > error: depends on 'libfmt.so.9', which cannot be found in RUNPATH > ("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib") > --8<---------------cut here---------------end--------------->8--- >=20 > So the =E2=80=98ld=E2=80=99 wrapper is indeed passing =E2=80=98-rpath /pa= th/to/fmt=E2=80=99 but down > the road that gets lost.=C2=A0 Could it be that Meson removes it when it > install files? So it seems. I retried this in a `guix shell`, and: --8<---------------cut here---------------start------------->8--- $ ldd build/hello linux-vdso.so.1 (0x00007fffd54f9000) libfmt.so.10 =3D> /gnu/store/cn0vmkz3h0wz0wz6hbdnjv4zphzr8z06- fmt-10.2.1/lib/libfmt.so.10 (0x00007fecae2e1000) libc.so.6 =3D> /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99- glibc-2.35/lib/libc.so.6 (0x00007fecae0e5000) libstdc++.so.6 =3D> /gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c- gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007fecade00000) libm.so.6 =3D> /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99- glibc-2.35/lib/libm.so.6 (0x00007fecadd23000) libgcc_s.so.1 =3D> /gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c- gcc-11.3.0-lib/lib/libgcc_s.so.1 (0x00007fecae0c9000) //gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc- 2.35/lib/ld-linux-x86-64.so.2 =3D> /gnu/store/daas786mm1zi3kxp03640n6anhrlrcng-glibc-2.35/lib/ld-linux- x86-64.so.2 (0x00007fecae30b000) --8<---------------cut here---------------end--------------->8-- but after installing --8<---------------cut here---------------start------------->8--- $ ldd build/.install/bin/hello=20 linux-vdso.so.1 (0x00007fffbc269000) libfmt.so.10 =3D> not found libc.so.6 =3D> /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99- glibc-2.35/lib/libc.so.6 (0x00007fae94274000) //gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc- 2.35/lib/ld-linux-x86-64.so.2 =3D> /gnu/store/daas786mm1zi3kxp03640n6anhrlrcng-glibc-2.35/lib/ld-linux- x86-64.so.2 (0x00007fae94477000) --8<---------------cut here---------------end--------------->8-- If I recall correctly, Meson performs separate linking on install, so that certain stuff works from the build directory without resorting to `./pre-inst-env` or the like.=C2=B9 However, why does it not find libfmt.s= o when using Clang, but does find it when using GCC? Does our clang- toolchain prepare the correct wrapper? I feel like lld might be hidden and unpatched in there =E2=80=93 or something else weird is happening. Cheers =C2=B9 I actually can't support this claim, as the GUIX_LD_WRAPPER_DEBUG only shows up on build as expected even with the gcc-toolchain variant.