unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 30395@debbugs.gnu.org
Subject: bug#30395: ‘gcc’ doesn't compile with LD_LIBRARY_PATH="$HOME/.guix-profile/lib"
Date: Fri, 16 Feb 2018 13:01:21 +0100	[thread overview]
Message-ID: <87mv09gn3i.fsf@gnu.org> (raw)
In-Reply-To: <87k1vdqm09.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 16 Feb 2018 11:14:46 +0100")

Hi Ludo,

ludo@gnu.org (Ludovic Courtès) writes:

> Mathieu Lirzin <mthl@gnu.org> skribis:
>
>> I have been facing a weird issue where some shitty build tool I was
>> using has tried to run ‘cmake’ after setting LD_LIBRARY_PATH.  The
>> result was a non terminating call to ‘collect2’.
>>
>> Here is a way to reproduce the issue:
>>
>>   $ guix environment --pure --ad-hoc gcc-toolchain
>>   $ echo "int main() { return 0; }" > foo.c
>>   $ LD_LIBRARY_PATH="$HOME/.guix-profile/lib" gcc foo.c
>
> That works for me (i.e., ‘gcc’ runs to completion just fine.)
>
> But I suppose this depends on what’s in ~/.guix-profile/lib.  If you
> have a conflicting GCC version there (which is not the case for me), it
> could break.

Interesting. :-)

> Could you run the snippet you provided above with ‘--verbose’ passed to
> ‘gcc’?  That will allow us to see what libraries and tools it picks up.

Here it is

--8<---------------cut here---------------start------------->8---
mthl@godel ~ [env]$ LD_LIBRARY_PATH="$HOME/.guix-profile/lib" gcc --verbose foo.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: 
Thread model: posix
gcc version 7.3.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/cc1 -quiet -v foo.c -quiet -dumpbase foo.c -mtune=generic -march=x86-64 -auxbase foo -version -o /tmp/ccU8U3nt.s
GNU C11 (GCC) version 7.3.0 (x86_64-unknown-linux-gnu)
	compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/no-gcc-local-prefix/include"
ignoring nonexistent directory "/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/../../../../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /gnu/store/9nxcfpfyrcz3aifwg55nls92sa3rhzs2-profile/include
 /gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include
 /gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/include-fixed
 /gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/include
End of search list.
GNU C11 (GCC) version 7.3.0 (x86_64-unknown-linux-gnu)
	compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 54a938749d3b2f496e537dee0d578856
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp/ccRLpf89.o /tmp/ccU8U3nt.s
GNU assembler version 2.28.1 (x86_64-unknown-linux-gnu) using BFD version (GNU Binutils) 2.28.1
COMPILER_PATH=/gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/:/gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/:/gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/:/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/:/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/gnu/store/9nxcfpfyrcz3aifwg55nls92sa3rhzs2-profile/lib/:/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/:/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/../../../:/gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/collect2 -plugin /gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/liblto_plugin.so -plugin-opt=/gnu/store/xjpchnxm9fgg05fqm9apyhqlqd5q5js8-gcc-7.3.0/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccKVXTVQ.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib/ld-linux-x86-64.so.2 /gnu/store/9nxcfpfyrcz3aifwg55nls92sa3rhzs2-profile/lib/crt1.o /gnu/store/9nxcfpfyrcz3aifwg55nls92sa3rhzs2-profile/lib/crti.o /gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/crtbegin.o -L/gnu/store/9nxcfpfyrcz3aifwg55nls92sa3rhzs2-profile/lib -L/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0 -L/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/../../.. -L/gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib /tmp/ccRLpf89.o -lgcc --as-needed -lgcc_s --no-as-needed -L/gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib -rpath=/gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib -rpath=/gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib -lgcc_s -lc -lgcc --as-needed -lgcc_s --no-as-needed /gnu/store/45rhjm5ryms10frcyrzcdp9yk4al4lnq-gcc-7.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/crtend.o /gnu/store/9nxcfpfyrcz3aifwg55nls92sa3rhzs2-profile/lib/crtn.o
--8<---------------cut here---------------end--------------->8---

>> When adding ‘binutils’ to the environment, the problem dissapears since
>> ‘ld-wrapper’ is not used anymore.
>
> What makes you think ‘ld-wrapper’ is involved?

GCC is waiting on ‘collect2’ to finish and ‘collect2’ according to [1]
tries to find ‘ld’.  When ‘ld’ is provided by Binutils the program
completes but not with ‘ld-wrapper’ on my machine, so I suspect this is
related to ‘ld-wrapper’, but maybe this is just a symptom of something
else.

Thanks.

[1] https://gcc.gnu.org/onlinedocs/gccint/Collect2.html

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

  reply	other threads:[~2018-02-16 12:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 17:20 bug#30395: ‘gcc’ doesn't compile with LD_LIBRARY_PATH="$HOME/.guix-profile/lib" Mathieu Lirzin
2018-02-16 10:14 ` Ludovic Courtès
2018-02-16 12:01   ` Mathieu Lirzin [this message]
2018-02-16 13:03     ` Ludovic Courtès
2018-02-16 14:56       ` Mathieu Lirzin
2018-02-16 16:43         ` Ludovic Courtès
2018-02-17 19:02           ` Mathieu Lirzin
2018-02-17 21:16             ` Ludovic Courtès
2018-02-17 22:49               ` Mathieu Lirzin
2018-02-18 13:51                 ` Ludovic Courtès
2018-02-18 21:51                   ` Mathieu Lirzin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mv09gn3i.fsf@gnu.org \
    --to=mthl@gnu.org \
    --cc=30395@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).