nixpkgs/pkgs/stdenv
Adam Joseph 122b6930b0 stdenv: cause makeStaticLibraries usage to agree with usage spec
The usage of `makeStaticLibraries` in stdenv/linux/default.nix is
prefaced by this comment:

  # Link GCC statically against GMP etc.  This makes sense because
  # these builds of the libraries are only used by GCC, so it
  # reduces the size of the stdenv closure.

However "these builds of the libraries are only used by GCC" is not
actually true.  As currently written, the stage4 coreutils links
against these customized, static-ified libraries.

Beside the fact that the code doesn't actually do what it says, this
causes other problems as well.  One example is #168983, which arises
because have a dynamically-linked binary (coreutils) which is built
from statically-linked libraries (libgmp.a); doing this causes mayhem
on platforms where `-fstack-protector` needs an auxiliary
`libssp.{so,a}` library; we end up with link failures because some
parts of the resulting binary want `libssp.so` and other parts want
`libssp_nonshared.a`.

Let's make the code actually do what the comment says, by moving these
definitions into the `gcc-unwrapped` override.  This will cause the
stage4-coreutils to link against libgmp dynamically, rather than
statically.  For this reason this commit depends on the previous
commit, which allows that to be done without creating a forbidden
reference from stdenv-final to the bootstrap-files.
2022-06-05 00:35:06 -07:00
..
cross
custom
cygwin
darwin Merge staging-next into staging 2022-05-31 18:01:50 +00:00
freebsd config.contentAddressedByDefault: init option 2022-04-27 23:21:32 +03:00
generic Merge staging-next into staging 2022-06-02 00:03:03 +00:00
linux stdenv: cause makeStaticLibraries usage to agree with usage spec 2022-06-05 00:35:06 -07:00
native
nix
adapters.nix treewide: stdenv.glibc -> glibc 2022-05-25 15:51:20 +03:00
booter.nix
common-path.nix fixLibtool(): patch ./configure, add file to common-path.nix 2022-05-26 13:53:36 -07:00
default.nix lib/systems: add mips64el definitions 2022-03-10 20:30:16 -08:00