Skip to content

gcc: clean up Darwin patches - #519065

Closed
emilazy wants to merge 6 commits into
NixOS:stagingfrom
emilazy:push-tnkpsrvqlsyr
Closed

emilazy wants to merge 6 commits into
NixOS:stagingfrom
emilazy:push-tnkpsrvqlsyr

Conversation

@emilazy

@emilazy emilazy commented May 11, 2026

Copy link
Copy Markdown
Member

I checked that this builds in like 2025, but not after rebasing. Will need testing before merging.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

nixpkgs-branch-check[bot]

This comment was marked as outdated.

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team, Ericson2314, balsoft and vcunat and removed request for a team May 11, 2026 16:07
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. labels May 11, 2026
@emilazy
emilazy changed the base branch from master to staging May 11, 2026 16:09
@nixpkgs-ci nixpkgs-ci Bot closed this May 11, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this May 11, 2026
nixpkgs-branch-check[bot]

This comment was marked as outdated.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: vim Advanced text editor 6.topic: stdenv Standard environment 6.topic: vscode A free and versatile code editor that supports almost every major programming language. 6.topic: k3s Kubernates distribution (https://k3s.io/) 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 6.topic: COSMIC COSMIC is a software platform for designing beautiful user experiences and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 11, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in Stdenv May 11, 2026
@emilazy emilazy closed this May 11, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Stdenv May 11, 2026
@emilazy emilazy reopened this May 11, 2026
@emilazy emilazy reopened this May 24, 2026
@emilazy

emilazy commented May 24, 2026

Copy link
Copy Markdown
Member Author

Sigh, sorry about the rebase mishap…

@nixpkgs-branch-check
nixpkgs-branch-check Bot dismissed stale reviews from themself May 24, 2026 19:11

Review dismissed automatically

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 6.topic: python Python is a high-level, general-purpose programming language. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels May 24, 2026
@sempiternal-aurora

Copy link
Copy Markdown
Contributor

Just a note, @zinzilulo managed to fix gcc13 compilation on darwin with the darwin gnat fixes we were working on in #522847, if that helps.

# GitHub's "compare" API produces unstable diffs, so we resort to reusing
# diffs from the Homebrew repo.
++ optionals canApplyIainsDarwinPatches (
++ optionals stdenv.targetPlatform.isDarwin (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason this is stdenv.targetPlatform and not stdenv.hostPlatform, like applying the other patches are above?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The patches are relevant for cross‐compiling to Darwin (and shouldn’t be relevant for cross‐compiling to other platforms from Darwin, I think).

'';

platforms = platforms.unix;
badPlatforms = lib.optionals (lib.versions.major version == "13") platforms.darwin;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should no longer be required, now that #522847 is in staging.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dropped. I haven’t tested the GNAT build, though.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 30, 2026
@sempiternal-aurora

sempiternal-aurora commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Currently this doesn't build on aarch64-darwin, because the gcc-15.3.0 iains patches don't apply properly to gcc-15.2.0. Rebasing this onto #531338 gives a different build failure, because the libgcc-darwin-detection patch fails to apply atop the 15.3.0 iains patchset. This isn't a problem with gcc14/16. Investigating the packages, it seems they removed the extra case in the match for x86_64-darwin, so modifying the patch to this makes it apply (to gcc-15.3.0):

--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -236,7 +236,7 @@ ;;
   esac
   tmake_file="$tmake_file t-slibgcc-darwin"
   case ${host} in
-    *-*-darwin2*)
+    *-*-darwin2* | *-*-darwin)
       tmake_file="t-darwin-min-11 $tmake_file"
       ;;
     *-*-darwin1[89]*)

Edit: With this patch applied, gnat15 builds as expected, and builds projects as expected, specifically ghdl-llvm, and it's tests.

@liberodark liberodark mentioned this pull request Jun 28, 2026
3 of 14 tasks
emilazy added 5 commits July 3, 2026 17:55
I’m pretty sure these should no longer be required after the
toolchain update and SDK rework.
The upstream issue was fixed, the branch has changes relevant to
`x86_64-darwin` too, and you don’t really want to target Darwin
without these patches.

We reorder the deployment target patch after the patches, as they touch
the same file, and apply it on AArch64 for all versions (but for Darwin
targets rather than hosts, which should be the relevant case anyway).
@moeleak

moeleak commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your work!

@vcunat

vcunat commented Jul 15, 2026

Copy link
Copy Markdown
Member

I thought these changes were all included in PR #531338 but by glancing at these two commit lists it seems like some might've been left behind. Either way, this PR needs to get updated past the other PR (or closed).

@sempiternal-aurora

Copy link
Copy Markdown
Contributor

I thought these changes were all included in PR #531338 but by glancing at these two commit lists it seems like some might've been left behind. Either way, this PR needs to get updated past the other PR (or closed).

Should be fine to be closed. I just rewrote the commits here a little in #531338, but they should apply to almost the same thing.

@vcunat

vcunat commented Jul 18, 2026

Copy link
Copy Markdown
Member

OK, reopen if you disagree, @emilazy in particular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

Archived in project
Status: Done

Development

Successfully merging this pull request may close these issues.

pkgs.gcc16: fails to build on aarch64-apple-darwin

5 participants