diff --git a/pkgs/development/compilers/gcc/common/dependencies.nix b/pkgs/development/compilers/gcc/common/dependencies.nix index a38cdcb9e20f..fd9036c23ac6 100644 --- a/pkgs/development/compilers/gcc/common/dependencies.nix +++ b/pkgs/development/compilers/gcc/common/dependencies.nix @@ -15,6 +15,7 @@ , libucontext ? null , libxcrypt ? null , cloog ? null +, darwin ? null , isl ? null , zlib ? null , gnat-bootstrap ? null @@ -85,6 +86,7 @@ in ++ optionals langJava [ boehmgc zip unzip ] ++ optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs) ++ optionals (langGo && stdenv.hostPlatform.isMusl) [ libucontext ] + ++ optionals (lib.versionAtLeast version "14" && stdenv.hostPlatform.isDarwin) [ darwin.apple_sdk.frameworks.CoreServices ] ; # threadsCross.package after gcc6 so i assume its okay for 4.8 and 4.9 too diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index cb2a40dfe1c6..5e017a21fa1f 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -129,6 +129,7 @@ let buildPackages cloog withoutTargetLibc + darwin disableBootstrap disableGdbPlugin enableLTO diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index 801640e9411f..ab6798af835e 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -139,6 +139,11 @@ in # We only apply this patch when building a native toolchain for aarch64-darwin, as it breaks building # a foreign one: https://github.com/iains/gcc-12-branch/issues/18 ++ optionals (stdenv.isDarwin && stdenv.isAarch64 && buildPlatform == hostPlatform && hostPlatform == targetPlatform) ({ + "14" = [ (fetchpatch { + name = "gcc-14-darwin-aarch64-support.patch"; + url = "https://raw.githubusercontent.com/Homebrew/formula-patches/82b5c1cd38826ab67ac7fc498a8fe74376a40f4a/gcc/gcc-14.1.0.diff"; + sha256 = "sha256-jCY65l1DGdESNyzEmD8FFC/xMmqeqBIQF+BhT4uTBBU="; + }) ]; "13" = [ (fetchpatch { name = "gcc-13-darwin-aarch64-support.patch"; url = "https://raw.githubusercontent.com/Homebrew/formula-patches/3c5cbc8e9cf444a1967786af48e430588e1eb481/gcc/gcc-13.2.0.diff";