nixpkgs/pkgs/stdenv/linux
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
..
bootstrap-files pkgs/stdenv/linux: add powerpc64le bootstrap-files 2022-04-11 18:35:44 -07:00
bootstrap-tools Revert "stdenv bootstrap tools: adjust with glibc-2.34" 2022-04-04 20:40:41 +02:00
bootstrap-tools-musl Make the bootsrap respect the contentAddressedByDefault setting 2021-04-28 10:25:49 +02:00
default.nix stdenv: cause makeStaticLibraries usage to agree with usage spec 2022-06-05 00:35:06 -07:00
make-bootstrap-tools-cross.nix lib.systems: drop scaleway-c1 2022-05-27 12:02:39 +00:00
make-bootstrap-tools.nix stdenvBootstrapTools: inherit {cross,local}System 2022-05-31 14:32:27 +00:00