Skip to content

pkgsCross.aarch64-multiplatform.gcc13 (and other cross-builds) fail to build due to gcc version mismatch #244871

@trofi

Description

@trofi

Describe the bug

pkgsCross.aarch64-multiplatform.gcc13 fails to build on x86_64-linux.

Steps To Reproduce

$  nix build --no-link nixpkgs#pkgsCross.aarch64-multiplatform.gcc13 -L
...
gcc-aarch64-unknown-linux-gnu> make[2]: *** [../../../gcc-13.1.0/libgcc/shared-object.mk:14: extendbfsf2.o] Error 1
gcc-aarch64-unknown-linux-gnu> make[2]: *** Waiting for unfinished jobs....
gcc-aarch64-unknown-linux-gnu> In file included from ../../../gcc-13.1.0/libgcc/soft-fp/trunctfbf2.c:30:
gcc-aarch64-unknown-linux-gnu> ../../../gcc-13.1.0/libgcc/soft-fp/brain.h:62:1: error: unable to emulate 'BF'
gcc-aarch64-unknown-linux-gnu>    62 | typedef float BFtype __attribute__ ((mode (BF)));
gcc-aarch64-unknown-linux-gnu>       | ^~~~~~~

Expected behavior

Build should succeed.

Additional context

I think the main cause is that cross-compiler version used to cross-build gcc does not match: cross-building gcc-13 requires gcc-13 cross-compiler presence. The build uses gcc-12 (without recently added bfloat support).

Similar kind of problem happens whee we try to build nixpkgs#pkgsCross.aarch64-multiplatform.gcc11 where newly added warning in gcc12 trigger -Werror= failures on gcc-11.

Metadata

$ nix-shell -p nix-info --run "nix-info -m"

 - system: `"x86_64-linux"`
 - host os: `Linux 6.4.3, NixOS, 23.11 (Tapir), 23.11.20230722.0b411c1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.16.1`
 - channels(root): `""`
 - channels(slyfox): `""`
 - nixpkgs: `/run/current-system/sw/share/nixos-flakes/inputs/nixpkgs`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: cross-compilationBuilding packages on a different platform than they will be used on
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions