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: do not allow version skew when cross-building gcc #352821

Merged
merged 1 commit into from
Nov 25, 2024

Commits on Nov 25, 2024

  1. gcc: do not allow version skew when cross-building gcc

    When `gcc` is cross-built (`build` != `target` && `host` == `target`)
    `gcc` assumes that it has a compatible cross-compiler in the environment
    that can build target libraries. Version of a cross-compiler has to
    match the compiler being cross-built as libraries frequently use fresh
    compiler features, like `-std=c++26` or target-specific types like
    `_Bfloat16`.
    
    Version mismatch causes build failures like:
    
        NixOS#351905
    
    Similar problems (but on a smaller scale) happen when a `gcc`
    cross-compiler is built (`build` == `host` && `host` != `target`) built
    by a mismatching version of a native compiler (`build` == `host` &&
    `host` == `target`). That was worked around by forcing `gcc9Stdenv` for
    older compiler versions.
    
    Let's fix both problems by requiring the same compiler version for
    cross-case.
    
    Closes: NixOS#351905
    trofi committed Nov 25, 2024
    Configuration menu
    Copy the full SHA
    9047491 View commit details
    Browse the repository at this point in the history