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

gcc11: Update back to 11.3 on Darwin #196565

Merged
merged 2 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions pkgs/development/compilers/gcc/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ with lib;
with builtins;

let majorVersion = "11";
# The patch below for aarch64-darwin does not apply to 11.3.0 and an
# updated version is not available. Keep aarch64-darwin on 11.2.0 so the
# large body of packages which depend on gfortran are still functional
# until GCC 12 is the default.
# On x86_64-darwin, building libgcc suffers from some different issues with 11.3.0.
version = if stdenv.isDarwin then
"${majorVersion}.2.0" else "${majorVersion}.3.0";
version = "${majorVersion}.3.0";
Copy link
Member

Choose a reason for hiding this comment

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

Instead of manually setting majorVersion we should use lib.versions.major version

Copy link
Member

Choose a reason for hiding this comment

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

Could be done, but on all versions consistently... and it doesn't seem very related to this PR.


inherit (stdenv) buildPlatform hostPlatform targetPlatform;

Expand All @@ -70,10 +64,14 @@ let majorVersion = "11";
++ optional langFortran ../gfortran-driving.patch
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch

++ optional (stdenv.isDarwin && stdenv.isAarch64) (fetchpatch {
url = "https://github.com/fxcoudert/gcc/compare/releases/gcc-11.2.0...gcc-11.2.0-arm-20211201.diff";
sha256 = "sha256-z62s/cXuH9Kgq/oD/OiiZ8LWnX1xl1D43sONnwaEW1w=";
})
++ optionals stdenv.isDarwin [
(fetchpatch {
# There are no upstream release tags in https://github.com/iains/gcc-11-branch.
# 2d280e7 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-11.3.0
url = "https://github.com/iains/gcc-11-branch/compare/2d280e7eafc086e9df85f50ed1a6526d6a3a204d..gcc-11.3-darwin-r2.diff";
sha256 = "sha256-LFAXUEoYD7YeCG8V9mWanygyQOI7U5OhCRIKOVCCDAg=";
})
]

# Obtain latest patch with ../update-mcfgthread-patches.sh
++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch;
Expand All @@ -93,9 +91,7 @@ stdenv.mkDerivation ({

src = fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
sha256 = if stdenv.isDarwin
then "sha256-0I7cU2tUw3KhAQ/2YZ3SdMDxYDqkkhK6IPeqLNo2+os="
else "sha256-tHzygYaR9bHiHfK7OMeV+sLPvWQO3i0KXhyJ4zijrDk=";
sha256 = "sha256-tHzygYaR9bHiHfK7OMeV+sLPvWQO3i0KXhyJ4zijrDk=";
};

inherit patches;
Expand Down
5 changes: 1 addition & 4 deletions pkgs/development/libraries/silgraphite/graphite2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
, freetype
, cmake
, static ? stdenv.hostPlatform.isStatic
, libgcc
}:

stdenv.mkDerivation rec {
Expand All @@ -19,9 +18,7 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ freetype ]
# On aarch64-darwin libgcc won't even build currently, and it doesn't seem needed.
++ lib.optionals (with stdenv; !cc.isGNU && !(isDarwin && isAarch64)) [ libgcc ];
buildInputs = [ freetype ];

patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];

Expand Down