From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bengt Richter Subject: bug#37999: clang fails to pickup/supply startfiles to ld Date: Thu, 31 Oct 2019 06:16:33 -0700 Message-ID: <20191031131633.GA8581@PhantoNv4ArchGx.localdomain> References: Reply-To: Bengt Richter Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35583) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQAK0-0006On-TG for bug-guix@gnu.org; Thu, 31 Oct 2019 09:17:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQAJz-00064g-7T for bug-guix@gnu.org; Thu, 31 Oct 2019 09:17:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQAJy-00063O-Al for bug-guix@gnu.org; Thu, 31 Oct 2019 09:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQAJy-00013H-1b for bug-guix@gnu.org; Thu, 31 Oct 2019 09:17:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Carl Dong Cc: 37999@debbugs.gnu.org Hi Carl, On +2019-10-30 20:48:55 +0000, Carl Dong wrote: > Hi all, > > Our clang toolchain seems to be quite broken at this time. In particular, it > fails to call `ld` in the right way such that the startfiles are picked up: > I suppose you know that guix ld is more complex than plain vanilla gnu. I was curious, and poked around a bit, but I don't have time to pursue it. But here is an intereting sampler: --8<----(spelunking guix ld)-----------cut here---------------start------------->8--- [05:48 ~/bs]$ which ld|xargs readlink -f /gnu/store/9ysmg2739n1ms84lx6hifncgc5l2hiy9-ld-wrapper-0/bin/ld [05:48 ~/bs]$ which ld|xargs readlink -f|xargs file /gnu/store/9ysmg2739n1ms84lx6hifncgc5l2hiy9-ld-wrapper-0/bin/ld: a /gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash script, ASCII text e xecutable [05:48 ~/bs]$ which ld|xargs readlink -f|xargs wc 289 1272 11903 /gnu/store/9ysmg2739n1ms84lx6hifncgc5l2hiy9-ld-wrapper-0/bin/ld [05:49 ~/bs]$ which ld|xargs readlink -f|xargs cat -n|head 1 #!/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash 2 # -*- mode: scheme; coding: utf-8; -*- 3 4 # XXX: We have to go through Bash because there's no command-line switch to 5 # augment %load-compiled-path, and because of the silly 127-byte limit for 6 # the shebang line in Linux. 7 # Use `load-compiled' because `load' (and `-l') doesn't otherwise load our 8 # .go file (see ). 9 # Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon 10 # incompatible .go files. See [05:49 ~/bs]$ which ld|xargs readlink -f|xargs cat -n|grep -i real 66 (define %real-ld 273 ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. 285 %real-ld args) 287 (apply execl %real-ld (basename %real-ld) args))) [05:50 ~/bs]$ which ld|xargs readlink -f|xargs cat -n|grep -im1 -A 2 real 66 (define %real-ld 67 ;; Name of the linker that we wrap. 68 "/gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld") [05:51 ~/bs]$ [05:52 ~/bs]$ readlink -f /gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld /gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld [05:54 ~/bs]$ file /gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld /gnu/store/02iklp4swqs0ipxhg5x9b2shmj6b30h1-binutils-2.31.1/bin/ld: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /gnu/st ore/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped [05:54 ~/bs]$ file /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2 /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2: symbolic link to ld-2.28.so [05:56 ~/bs]$ readlink -f /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28//lib/ld-linux-x86-64.so.2 /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-2.28.so [05:57 ~/bs]$ file /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-2.28.so /gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-2.28.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped --8<----(spelunking guix ld)-----------cut here---------------end--------------->8--- HTH in some way. -- Regards, Bengt Richter