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/11: apply upstream fix 103910 so openjdk builds #212363

Merged
merged 1 commit into from Feb 13, 2023
Merged

gcc/11: apply upstream fix 103910 so openjdk builds #212363

merged 1 commit into from Feb 13, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jan 24, 2023

Description of changes

Our openjdk derivations fail to build with -march=opteron (via either NIX_CFLAGS_COMPILE or hostPlatform.gcc.arch). This was fixed upstream in gcc12 but not carried back to gcc11:

https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=d243f4009d8071b734df16cd70f4c5d09a373769

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103910

Since gcc11 is still nixpkgs' primary compiler, this PR cherry-picks the fix out of gcc12.

Unfortunately since -march= can be added after the gcc11 derivation is built we can't apply this patch conditionally (which we don't usually do anyways).

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.05 Release Notes (or backporting 22.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

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

fetchurl won't have a stable hash in this case. This web generates the patch dynamically - there's even git version in the output. I'd most likely just add the file into nixpkgs git just as others. (fetchpatch is problematic during stdenv bootstrapping)

@vcunat vcunat changed the base branch from staging to staging-next February 1, 2023 16:22
@vcunat
Copy link
Member

vcunat commented Feb 1, 2023

(On current staging-next any gcc11 changes shouldn't cause a big rebuild anymore.)

@ghost
Copy link
Author

ghost commented Feb 12, 2023

(On current staging-next any gcc11 changes shouldn't cause a big rebuild anymore.)

Sorry about the slow reply. I'm back now and dealing with the backlog.

@vcunat
Copy link
Member

vcunat commented Feb 12, 2023

Well, maybe this won't be important anymore, as gcc12 is becoming the default and shouldn't need this fix...

Our openjdk derivations fail to build with `-march=opteron` (via
either `NIX_CFLAGS_COMPILE` or `hostPlatform.gcc.arch`).  This was
fixed upstream in gcc12 but not carried back to gcc11:

  https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=d243f4009d8071b734df16cd70f4c5d09a373769

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103910

Since gcc11 is still nixpkgs' primary compiler, this PR cherry-picks
the fix out of gcc12.

Unfortunately since `-march=` can be added after the `gcc11`
derivation is built we can't apply this patch conditionally (which
we don't usually do anyways).
@ghost ghost marked this pull request as draft February 12, 2023 15:46
@ghost ghost marked this pull request as ready for review February 12, 2023 15:47
@vcunat vcunat merged commit a6767ed into NixOS:staging-next Feb 13, 2023
@vcunat
Copy link
Member

vcunat commented Feb 13, 2023

OK, why not.

@vcunat
Copy link
Member

vcunat commented Feb 13, 2023

Backport to staging-22.11, I guess? There gcc11 remains the default for x86_64-linux.

@github-actions
Copy link
Contributor

Successfully created backport PR for staging-22.11:

@ghost ghost deleted the pr/gcc/11/openjdk-fix-from-gcc12 branch January 23, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant