Subject: Re: bug#41038: gcc creates binaries that don't find their shared libraries

From: Bruno Haible <[email-masked]>
Date: Mon, 04 May 2020 01:09:10 +0200

Hi Ludo,

> > $ guix install make gcc-toolchain binutils glibc gdb gettext m4 autoconf automake
> 
> It’s a mistake to explicitly binutils and glibc: they are provided by
> ‘gcc-toolchain’ along with an ‘ld’ wrapper that takes care of adding
> entries to the RUNPATH of binaries:
> 
>   https://guix.gnu.org/manual/en/html_node/Application-Setup.html#The-GCC-toolchain
> 
> ‘binutils’ shadowed that wrapper.  I admit what you did looks perfectly
> legit at first sight and the failure mode isn’t great.
> 
> The fix is to run:
> 
>   guix remove glibc binutils

This does fix it, thank you.

The question "What packages do I need to do normal C development?" should
really be documented.

How about a doc section - at the beginning of the chapter
https://guix.gnu.org/manual/en/html_node/Development.html - that says:

  Packages needed for C development
  =================================

  For C development, you will typically need the packages
    make gcc-toolchain gdb

  Do NOT install glibc and binutils explicitly, as they would shadow
  the 'ld' wrapper that is necessary for proper operation of GCC.

Additionally, the documentation page
https://guix.gnu.org/manual/en/html_node/Application-Setup.html
starts with the sentence
  "When using Guix on top of GNU/Linux distribution other than Guix System ..."
but then the majority of the page applies to native Guix as well.
How about restructuring this documentation chapter into two pages:
  - one that explains things valid about Guix in general,
  - one that covers only the foreign-distro topics.

> Another way to do software development is with ‘guix environment’:
> 
>   https://guix.gnu.org/manual/en/html_node/Development.html
> 
> For example, if you want to hack on Gettext, run:
> 
>   guix environment gettext
> 
> That spawns a shell containing all the development tools and environment
> variables to hack on gettext.

Sounds very interesting. But for the moment, I use guix only as a
test platform.

Bruno