Skip to content

[Backport staging-25.11] cc-wrapper, gcc, gnat, gnat-bootstrap: fix GCC 13 and GNAT 13/14/15 builds on darwin - #525200

Closed
zinzilulo wants to merge 1 commit into
NixOS:staging-25.11from
zinzilulo:backport-522847-to-staging-25.11
Closed

zinzilulo wants to merge 1 commit into
NixOS:staging-25.11from
zinzilulo:backport-522847-to-staging-25.11

Conversation

@zinzilulo

Copy link
Copy Markdown
Contributor

Backport of #522847.

Things done

@nixpkgs-commit-check nixpkgs-commit-check Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This report is automatically generated by the PR / Check / cherry-pick CI workflow.

Some of the commits in this PR require the author's and reviewer's attention.

Sometimes it is not possible to cherry-pick exactly the same patch.
This most frequently happens when resolving merge conflicts.
The range-diff will help to review the resolution of conflicts.

If you need to merge this PR despite the warnings, please dismiss this review shortly before merging.

Warning

Difference between e3325b5 and original 481208b may warrant inspection.

Show diff
@@ Metadata
  ## Commit message ##
     cc-wrapper, gcc, gnat, gnat-bootstrap: fix GCC 13 and GNAT 13/14/15 builds on darwin
 
+    (cherry picked from commit 481208bdff2dc2f61d4f4fde51e6bd2a939f7d68)
+
  ## pkgs/build-support/cc-wrapper/default.nix ##
 @@
+   nixSupport ? { },
    isGNU ? false,
    isClang ? cc.isClang or false,
-   isFlang ? cc.isFlang or false,
 +  isAlireGNAT ? false,
    isZig ? cc.isZig or false,
    isArocc ? cc.isArocc or false,
@@ pkgs/build-support/cc-wrapper/default.nix: stdenvNoCC.mkDerivation {
 +    # Injecting CFlags and LDFlags causes duplicate rpath at linking
 +    # stage for Alire GNAT. Skip adding flags here.
 +    + optionalString (!nativeTools && !isArocc && !isAlireGNAT) ''
-       ccLDFlags=()
-       ccCFlags=()
++      ccLDFlags=()
++      ccCFlags=()
        if [ -e "${cc_solib}/lib64" -a ! -L "${cc_solib}/lib64" ]; then
+         ccLDFlags+=" -L${cc_solib}/lib64"
+         ccCFlags+=" -B${cc_solib}/lib64"
 @@ pkgs/build-support/cc-wrapper/default.nix: stdenvNoCC.mkDerivation {
        touch "$out/nix-support/gnat-cflags"
        touch "$out/nix-support/gnat-ldflags"
        basePath=$(echo $cc/lib/*/*/*)
--      ccCFlags+=("-B$basePath" "-I$basePath/adainclude")
+-      ccCFlags+=" -B$basePath -I$basePath/adainclude"
        gnatCFlags="-I$basePath/adainclude -I$basePath/adalib"
  
        echo "$gnatCFlags" >> $out/nix-support/gnat-cflags
@@ pkgs/development/compilers/gcc/common/dependencies.nix: in
      texinfo
      which
 -    gettext
-     autoconf269
    ]
 +  ++ optionals (!is13) [ gettext ]
    ++ optionals (perl != null) [ perl ]
@@ pkgs/development/compilers/gcc/default.nix
  }:
  
 @@ pkgs/development/compilers/gcc/default.nix: let
-   majorVersion = versions.major version;
+   is14 = majorVersion == "14";
    is13 = majorVersion == "13";
  
 +  appleSdk = if langAda && !is13 then apple-sdk_15 else apple-sdk_14;
@@ pkgs/development/compilers/gcc/default.nix: let
 -      apple-sdk
 +      apple-sdk_14
 +      apple-sdk_15
-       autoconf269
        binutils
        buildPackages
+       cargo
 @@ pkgs/development/compilers/gcc/default.nix: let
        gnat-bootstrap
        gnused
@@ pkgs/top-level/all-packages.nix: with pkgs;
 -          && stdenv.buildPlatform.isx86_64
          then
 -          overrideCC stdenv gnat-bootstrap14
-+          overrideCC gccStdenv gnat-bootstrap14
-         else
-           stdenv;
-     }
-@@ pkgs/top-level/all-packages.nix: with pkgs;
-           stdenv.hostPlatform == stdenv.targetPlatform
-           && stdenv.buildPlatform == stdenv.hostPlatform
-           && stdenv.buildPlatform.isDarwin
--          && stdenv.buildPlatform.isx86_64
-         then
--          overrideCC stdenv gnat-bootstrap14
 +          overrideCC gccStdenv gnat-bootstrap14
          else
            stdenv;

Hint: The full diffs are also available in the runner logs with slightly better highlighting.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.first-time contribution This PR is the author's first one; please be gentle! 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 4.workflow: backport This targets a stable branch labels May 28, 2026
@zinzilulo

Copy link
Copy Markdown
Contributor Author

Closed as it breaks gnat13 on x86_64/aarch64-linux and x86_64-darwin.

@zinzilulo zinzilulo closed this May 29, 2026
@zinzilulo
zinzilulo deleted the backport-522847-to-staging-25.11 branch June 2, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.workflow: backport This targets a stable branch 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-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant