Skip to content

Commit

Permalink
{gcc{7,8}{,Stdenv},gfortran{7,8}}: drop (NixOS#357657)
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptaron authored Nov 24, 2024
2 parents 3e79601 + 20c5d92 commit 0ed5698
Show file tree
Hide file tree
Showing 30 changed files with 21 additions and 1,950 deletions.
10 changes: 0 additions & 10 deletions pkgs/by-name/gf/gfortran7/package.nix

This file was deleted.

10 changes: 0 additions & 10 deletions pkgs/by-name/gf/gfortran8/package.nix

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/by-name/qm/qmk/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ python3.pkgs.buildPythonApplication rec {
gnumake
pkgsCross.avr.buildPackages.binutils
pkgsCross.avr.buildPackages.binutils.bintools
pkgsCross.avr.buildPackages.gcc8
pkgsCross.avr.buildPackages.gcc
pkgsCross.avr.libcCross
];

Expand Down
13 changes: 4 additions & 9 deletions pkgs/development/compilers/gcc/all.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, gccStdenv
, gcc9Stdenv
, callPackage
, isl_0_17, isl_0_20
, isl_0_20
, libcCross
, threadsCross
, noSysDirs
Expand All @@ -17,20 +17,15 @@ let
let
atLeast = lib.versionAtLeast majorMinorVersion;
attrName = "gcc${lib.replaceStrings ["."] [""] majorMinorVersion}";
pkg = lowPrio (wrapCC (callPackage ./default.nix ({
pkg = lowPrio (wrapCC (callPackage ./default.nix {
inherit noSysDirs;
inherit majorMinorVersion;
reproducibleBuild = true;
profiledCompiler = false;
libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then args.libcCross else null;
threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { };
isl = if stdenv.hostPlatform.isDarwin then null
else if atLeast "9" then isl_0_20
else /* atLeast "7" */ isl_0_17;
} // lib.optionalAttrs (!(atLeast "9")) {
# gcc 10 is too strict to cross compile gcc <= 8
stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc9Stdenv else stdenv;
})));
isl = if stdenv.hostPlatform.isDarwin then null else isl_0_20;
}));
in
lib.nameValuePair attrName pkg;
in
Expand Down
33 changes: 7 additions & 26 deletions pkgs/development/compilers/gcc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,12 @@ let
atLeast12 = versionAtLeast version "12";
atLeast11 = versionAtLeast version "11";
atLeast10 = versionAtLeast version "10";
atLeast9 = versionAtLeast version "9";
atLeast8 = versionAtLeast version "8";
is14 = majorVersion == "14";
is13 = majorVersion == "13";
is12 = majorVersion == "12";
is11 = majorVersion == "11";
is10 = majorVersion == "10";
is9 = majorVersion == "9";
is8 = majorVersion == "8";
is7 = majorVersion == "7";

disableBootstrap = atLeast11 && !stdenv.hostPlatform.isDarwin && (atLeast12 -> !profiledCompiler);

Expand Down Expand Up @@ -166,7 +162,7 @@ assert stdenv.buildPlatform.isDarwin -> gnused != null;

# The go frontend is written in c++
assert langGo -> langCC;
assert (!is7 && !is8) -> (langAda -> gnat-bootstrap != null);
assert langAda -> gnat-bootstrap != null;

# TODO: fixup D bootstapping, probably by using gdc11 (and maybe other changes).
# error: GDC is required to build d
Expand Down Expand Up @@ -261,9 +257,7 @@ pipe ((callFile ./common/builder.nix {}) ({

configurePlatforms = [ "build" "host" "target" ];

configureFlags = (callFile ./common/configure-flags.nix { })
++ optional (is7 && targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
++ optional (is7 && targetPlatform.isNetBSD) "--disable-libcilkrts";
configureFlags = callFile ./common/configure-flags.nix { };

inherit targetConfig;

Expand Down Expand Up @@ -319,30 +313,22 @@ pipe ((callFile ./common/builder.nix {}) ({
EXTRA_FLAGS_FOR_TARGET
EXTRA_LDFLAGS_FOR_TARGET
;
} // optionalAttrs is7 {
NIX_CFLAGS_COMPILE = optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"
# Downgrade register storage class specifier errors to warnings when building a cross compiler from a clang stdenv.
+ optionalString (stdenv.cc.isClang && targetPlatform != hostPlatform) " -Wno-register";
} // optionalAttrs (!is7 && !atLeast12 && stdenv.cc.isClang && targetPlatform != hostPlatform) {
} // optionalAttrs (!atLeast12 && stdenv.cc.isClang && targetPlatform != hostPlatform) {
NIX_CFLAGS_COMPILE = "-Wno-register";
});

passthru = {
inherit langC langCC langObjC langObjCpp langAda langFortran langGo langD version;
isGNU = true;
hardeningUnsupportedFlags =
optional (
(targetPlatform.isAarch64 && !atLeast9) || !atLeast8
) "stackclashprotection"
++ optional (!atLeast11) "zerocallusedregs"
optional (!atLeast11) "zerocallusedregs"
++ optionals (!atLeast12) [ "fortify3" "trivialautovarinit" ]
++ optional (!(
atLeast8
&& targetPlatform.isLinux
targetPlatform.isLinux
&& targetPlatform.isx86_64
&& targetPlatform.libc == "glibc"
)) "shadowstack"
++ optional (!(atLeast9 && targetPlatform.isLinux && targetPlatform.isAarch64)) "pacret"
++ optional (!(targetPlatform.isLinux && targetPlatform.isAarch64)) "pacret"
++ optionals (langFortran) [ "fortify" "format" ];
};

Expand All @@ -359,10 +345,7 @@ pipe ((callFile ./common/builder.nix {}) ({
maintainers
;
} // optionalAttrs (!atLeast11) {
badPlatforms =
# avr-gcc8 is maintained for the `qmk` package
if (is8 && targetPlatform.isAvr) then []
else [ "aarch64-darwin" ];
badPlatforms = [ "aarch64-darwin" ];
} // optionalAttrs is10 {
badPlatforms = if targetPlatform != hostPlatform then [ "aarch64-darwin" ] else [ ];
};
Expand All @@ -371,8 +354,6 @@ pipe ((callFile ./common/builder.nix {}) ({
preBuild = ''
makeFlagsArray+=('STRIP=${getBin cctools}/bin/${stdenv.cc.targetPrefix}strip')
'';
} // optionalAttrs (!atLeast8) {
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
} // optionalAttrs enableMultilib {
dontMoveLib64 = true;
}
Expand Down
16 changes: 0 additions & 16 deletions pkgs/development/compilers/gcc/patches/4.9/darwin-clang-as.patch

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0ed5698

Please sign in to comment.