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

linux: build with GCC 13 for loongarch64 #239745

Closed
wants to merge 1 commit into from
Closed

Conversation

alyssais
Copy link
Member

Description of changes

Linux requires either binutils ≤ 2.39 or GCC ≥ 13 to build for loongarch64.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d8dad7048611e5ba02ae8519539ce4b8b1482d3
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=11cd8a648301af0ad6937ed9493519d1e93fd4c8

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@alyssais alyssais added the 6.topic: exotic Exotic hardware or software platform label Jun 25, 2023
@alyssais alyssais requested a review from trofi June 25, 2023 13:42
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jun 25, 2023
Copy link
Contributor

@trofi trofi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding a comment right into the .nix fiiles as well? Otherwise LGTM.

@Janik-Haag Janik-Haag added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jun 26, 2023
@wineee
Copy link
Member

wineee commented Jul 29, 2023

I prefer to upgrade the stdenv of loongarch64 to GCC 13 instead of specifying the use of gcc13Stdenv when compiling Linux kernels.

As a new architecture, loongarch64 can undoubtedly get new feature support by using the new version of gcc

In a blog of loongson community developer recommends using the 13.0.0 snapshot release for new psABI support. (It should be noted that this blog is updated in 2022-11)

In practice, loongarchlinux as a distribution specifically designed for loongarch, uses GCC 13 and does not provide GCC 12 or any older versions.

The requirement of using GCC >= 13 for Linux kernels indicates that we need to upgrade the gcc in stdenv as well.

@ghost
Copy link

ghost commented Aug 14, 2023

I prefer to upgrade the stdenv of loongarch64 to GCC 13 instead of specifying the use of gcc13Stdenv when compiling Linux kernels.

Agree. #245169 creates a designated place for this (and lets you make changes like this via overlays instead of having to edit nixpkgs).

Also, when we bump to gcc14 by default, unless somebody remembers to change (all four of) these, we'll wind up with Loongarch using an older gcc than the default, rather than newer. The gccXStdenvs are meant for holding back to an older version, not for experimenting with newer versions. If you have old code that can't use the latest GCC, an even newer version of GCC isn't going to fix that, which is why it's okay to use a fixed version number in that situation.

If there is a strong reason for wanting gcc13 only for the kernel but not elsewhere, we should put that change on just one line in one place somewhere (like .override { stdenv = gcc13Stdenv; }) guarded by if lib.versionOlder stdenv.cc.cc.version "13.0".

@wegank wegank marked this pull request as draft March 9, 2024 22:16
@wegank
Copy link
Member

wegank commented Mar 9, 2024

I guess it's not necessary anymore.

@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2024
@wineee
Copy link
Member

wineee commented Sep 5, 2024

gcc 13 is default now

@wineee wineee closed this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: exotic Exotic hardware or software platform 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants