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

From: [email-masked] (Ludovic Courtès)
Date: Fri, 16 Feb 2018 11:14:46 +0100

Hi Mathieu,

Mathieu Lirzin <[email-masked]> 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.

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.

> When adding ‘binutils’ to the environment, the problem dissapears since
> ‘ld-wrapper’ is not used anymore.

What makes you think ‘ld-wrapper’ is involved?

Anyway, the ‘--verbose’ output should give us more insight.

Thanks,
Ludo’.