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

gcc: don't use old cross-compiler build a new native compiler #249301

Closed
wants to merge 10 commits into from
Closed

gcc: don't use old cross-compiler build a new native compiler #249301

wants to merge 10 commits into from

Commits on Aug 15, 2023

  1. default-gcc-version: init

    This commit lifts the default gcc version to a top-level attribute
    so it can be overridden.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    8fcb426 View commit details
    Browse the repository at this point in the history
  2. gcc: add passthru.{target_libc,target_libgcc}

    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    627cf7c View commit details
    Browse the repository at this point in the history
  3. gccFun: allow to specify the version of gcc

    This commit causes `gccFun` to use `callPackage` with an argument
    `gcc_major_version` to indicate which version of gcc is desired.  It
    defaults to `default-gcc-version`.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    723cd01 View commit details
    Browse the repository at this point in the history
  4. gccWithoutTargetLibc: inline let-binding for libcCross1

    This is stylistic; this code has been inherited from quite a long
    time ago, and I never understood what the `1` meant.  Let's just use
    `binutilsNoLibc.libc`, which is what `libcCross1` is defined to be,
    instead.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    6018a01 View commit details
    Browse the repository at this point in the history
  5. gccWithoutTargetLibc: allow to specify the version of gcc

    This commit causes `gccWithoutTargetLibc` to use `callPackage` with
    an argument `gcc_major_version` to indicate which version of gcc is
    desired.  It defaults to `default-gcc-version`.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    5c317fc View commit details
    Browse the repository at this point in the history
  6. gccWithoutTargetLibc: weaken assertion from target!=host to target!=b…

    …uild
    
    gccWithoutTargetLibc is useful not only for building cross
    compilers, but also for cross-building native compilers.  Let's
    allow it to be used in that situation.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    20b5f9c View commit details
    Browse the repository at this point in the history
  7. gcc: un-factor (x: (lowPrio (wrapCC x)))

    This commit simply changes
    
    ```
    pkg = lowPrio (wrapCC ... )
    ```
    
    into
    
    ```
    pkg = ...
    ```
    
    and wraps the sole occurrence of `pkg` with `lowPrio (wrapCC ... )`.
    It has no effect on eval.  I am placing it in a separate commit
    simply to make the next commit easier to understand.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    7077352 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    82aece4 View commit details
    Browse the repository at this point in the history
  9. libgcc: assert that it is built by gcc of same version

    This commit checks that libgcc is being built by gcc, and that the
    gcc it is being built by is exactly the same version.  Any other
    combination of compiler and libgcc is unlikely to work.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    7604600 View commit details
    Browse the repository at this point in the history
  10. gcc: do not use an old cross-compiler build a new native compiler

    Closes #244871
    
    This commit checks for the following situation: we are
    cross-building a native compiler (build!=(host==target)) using a
    cross-compiler ((build==host)!=target) which is *older than* the
    compiler being built.  We check both the cross-compiler itself as
    well as the cross-compiler which was used to build the copy of
    libgcc against which the target libc is linked.
    
    This configuration often fails (see
    #244871 for one example).
    
    If you need to cross-build a newer-than-default-gcc-version native
    compiler, you must first build a newer-than-default-gcc-version
    cross-compiler.  Previously, the user had to figure out how to hack
    in this upgrade on their own.  The code added by this commit inserts
    the extra compiler build automatically.
    Adam Joseph committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    efcb5e1 View commit details
    Browse the repository at this point in the history