Subject: Re: bug#30395: ‘gcc’ doesn't compile with LD_LIBRARY_PATH="$HOME/.guix-profile/lib"

From: Mathieu Lirzin <[email-masked]>
Date: Fri, 16 Feb 2018 15:56:21 +0100

[email-masked] (Ludovic Courtès) writes:

> Mathieu Lirzin <[email-masked]> skribis:
>
>> 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.
>
> Oooh, I see.  It could be the ‘guile’ used by ld-wrapper that fails
> somehow.
>
> Do you have ‘guile’ in ~/.guix-profile?  You could run again that gcc
> command, this time prefixed with “strace -f -o log” to see which
> libguile.so is being used when ‘ld’ is invoked, and whether something
> else is going on, such as auto-compilation or something?

I don't have ‘guile’ in my profile, but I have ‘[email-masked]’.

After looking at the attached ‘strace’ log, as you initially guessed
this issue is that multiple GCC are loaded.  My ‘gcc-toolchain’ is using
GCC 7.3 and ‘glibc’ is referring to GCC 5.4.

After removing ‘glibc’ and from my profile calling ‘gcc’ completes, so I
don't need to install ‘binutils’ in my profile anymore.  I must admit
that I still don't understand the details, but do you see a way to
prevent such silent misconfiguration?

Thanks for your time.

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