nixos-apple-silicon icon indicating copy to clipboard operation
nixos-apple-silicon copied to clipboard

build the kernel with a newer gcc

Open zzywysm opened this issue 3 years ago • 1 comments
trafficstars

At the moment, the kernel gets built with gcc-9.3. It would be nice if the kernel were built with gcc 11 or gcc 12 instead.

zzywysm avatar Jul 16 '22 02:07 zzywysm

Nixpkgs still uses gcc-9.3 for aarch64. There have been efforts to upgrade it but they didn't pan out. I'm not sufficiently competent in that area to figure out why.

Is there some benefit to using gcc 11 or 12 just for the kernel? That would require compiling another compiler.

tpwrules avatar Jul 16 '22 02:07 tpwrules

Here is a proposed fix from another author, which I'm going to try out on my own Mac:

https://github.com/helsinki-systems/nixpkgs/tree/fix/aarch64-linux-gcc10

(Contrary to the branch name, it looks like this would move nixpkgs to gcc-11.x for aarch64.)

zzywysm avatar Nov 28 '22 20:11 zzywysm

The root cause seems to be that this file hasn't been updated in a while:

https://github.com/NixOS/nixpkgs/commits/master/pkgs/stdenv/linux/bootstrap-files/aarch64.nix

...and it defines where the bootstrap files get copied from. Because the file is out of date, it's incompatible with newer gcc (and glibc?)

References: https://github.com/NixOS/nixpkgs/issues/36947 https://github.com/NixOS/nixpkgs/pull/36948 https://github.com/NixOS/nixpkgs/issues/40797

https://github.com/NixOS/nixpkgs/issues/108111 https://github.com/NixOS/nixpkgs/issues/108305 https://github.com/NixOS/nixpkgs/pull/187225

zzywysm avatar Nov 28 '22 20:11 zzywysm

This will eventually get fixed with https://github.com/NixOS/nixpkgs/pull/209870 so closing.

zzywysm avatar Jan 21 '23 00:01 zzywysm