Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdenv: make stage3.{gmp,mpfr,mpc,isl} do what the comment says #169378

Merged
merged 5 commits into from Jun 30, 2022
Merged

stdenv: make stage3.{gmp,mpfr,mpc,isl} do what the comment says #169378

merged 5 commits into from Jun 30, 2022

Commits on Jun 5, 2022

  1. stdenv: force gmp to rebuild in stage4 of the bootstrap

    As explained in the comment, this ensures that stage4-coreutils does
    not leak a reference to the bootstrap-files by way of libgmp.  This
    will allow the next patch in this series to build stage4-coreutils
    using a dynamically-linked (rather than statically-linked) libgmp.
    Adam Joseph committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    7fd7490 View commit details
    Browse the repository at this point in the history
  2. 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.
    Adam Joseph committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    122b693 View commit details
    Browse the repository at this point in the history
  3. stdenv: label the ephemeral coreutils-stage4 package

    During stdenv bootstrapping, coreutils is built twice.  This makes
    troubleshooting very difficult, because both packages have
    name="coreutils", so it is a hassle to figure out "which coreutils am
    I using / is not building"?
    
    The first of these builds is used only in stage4, and is not part of
    the final stdenv.  Let's label that one with a different `name`
    attribute to make it obvious which is which.
    Adam Joseph committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    23ea8b3 View commit details
    Browse the repository at this point in the history
  4. Update pkgs/stdenv/linux/default.nix

    Co-authored-by: sternenseemann <sternenseemann@systemli.org>
    2 people authored and Adam Joseph committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    a9e0d86 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0263018 View commit details
    Browse the repository at this point in the history