summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix194
-rw-r--r--pkgs/development/compilers/ghc/8.0.2.nix201
-rw-r--r--pkgs/development/compilers/ghc/8.2.1-binary.nix1
-rw-r--r--pkgs/development/compilers/ghc/8.6.2.nix (renamed from pkgs/development/compilers/ghc/8.4.3.nix)25
-rw-r--r--pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch23
-rw-r--r--pkgs/development/compilers/ghc/ghc-gold-linker.patch54
-rw-r--r--pkgs/development/compilers/ghc/ghc-no-madv-free.patch18
-rw-r--r--pkgs/development/compilers/ghc/relocation.patch27
8 files changed, 6 insertions, 537 deletions
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
deleted file mode 100644
index b69ae80d0db5..000000000000
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ /dev/null
@@ -1,194 +0,0 @@
-{ stdenv, targetPackages
-
-# build-tools
-, bootPkgs
-, coreutils, fetchurl, perl
-, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
-
-, libiconv ? null, ncurses
-
-, useLLVM ? !stdenv.targetPlatform.isx86
-, # LLVM is conceptually a run-time-only depedendency, but for
-  # non-x86, we need LLVM to bootstrap later stages, so it becomes a
-  # build-time dependency too.
-  buildLlvmPackages, llvmPackages
-
-, # If enabled, GHC will be built with the GPL-free but slower integer-simple
-  # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
-
-, # If enabled, use -fPIC when compiling static libs.
-  enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
-
-, # Whether to build dynamic libs for the standard library (on the target
-  # platform). Static libs are always built.
-  enableShared ? true
-
-, # What flavour to build. An empty string indicates no
-  # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
-}:
-
-let
-  inherit (stdenv) buildPlatform hostPlatform targetPlatform;
-
-  inherit (bootPkgs) ghc;
-
-  # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
-    (targetPlatform != hostPlatform)
-    "${targetPlatform.config}-";
-
-  docFixes = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
-    sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
-  };
-
-  buildMK = ''
-    BuildFlavour = ${ghcFlavour}
-    ifneq \"\$(BuildFlavour)\" \"\"
-    include mk/flavours/\$(BuildFlavour).mk
-    endif
-    DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
-  '' + stdenv.lib.optionalString enableIntegerSimple ''
-    INTEGER_LIBRARY = integer-simple
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
-    Stage1Only = YES
-    HADDOCK_DOCS = NO
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
-    GhcLibHcOpts += -fPIC
-    GhcRtsHcOpts += -fPIC
-  '';
-
-  # Splicer will pull out correct variations
-  libDeps = platform: [ ncurses ]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc") libiconv;
-
-  toolsForTarget =
-    if hostPlatform == buildPlatform then
-      [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
-    else assert targetPlatform == hostPlatform; # build != host == target
-      [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
-
-  targetCC = builtins.head toolsForTarget;
-
-in
-stdenv.mkDerivation rec {
-  version = "7.10.3";
-  name = "${targetPrefix}ghc-${version}";
-
-  src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g";
-  };
-
-  enableParallelBuilding = true;
-
-  outputs = [ "out" "doc" ];
-
-  patches = [
-    docFixes
-    ./relocation.patch
-  ];
-
-  postPatch = "patchShebangs .";
-
-  # GHC is a bit confused on its cross terminology.
-  preConfigure = ''
-    for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
-      export "''${env#TARGET_}=''${!env}"
-    done
-    # GHC is a bit confused on its cross terminology, as these would normally be
-    # the *host* tools.
-    export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
-    export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
-    export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
-    export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
-    export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
-    export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
-    export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
-    export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
-
-    echo -n "${buildMK}" > mk/build.mk
-    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-    export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '';
-
-  # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
-  # `--with` flags for libraries needed for RTS linker
-  configureFlags = [
-    "--datadir=$doc/share/doc/ghc"
-    "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
-    "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [
-    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
-    "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
-    # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    "--disable-large-address-space"
-  ];
-
-  # Make sure we never relax`$PATH` and hooks support for compatability.
-  strictDeps = true;
-
-  nativeBuildInputs = [
-    perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42
-    ghc bootPkgs.hscolour
-  ];
-
-  # For building runtime libs
-  depsBuildTarget = toolsForTarget;
-
-  buildInputs = libDeps hostPlatform;
-
-  propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
-
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
-
-  # required, because otherwise all symbols from HSffi.o are stripped, and
-  # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
-
-  hardeningDisable = [ "format" ];
-
-  postInstall = ''
-    # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
-
-    # Patch scripts to include "readelf" and "cat" in $PATH.
-    for i in "$out/bin/"*; do
-      test ! -h $i || continue
-      egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
-    done
-  '';
-
-  passthru = {
-    inherit bootPkgs targetPrefix;
-
-    inherit llvmPackages;
-    inherit enableShared;
-
-    # Our Cabal compiler name
-    haskellCompilerName = "ghc-7.10.3";
-  };
-
-  meta = {
-    homepage = http://haskell.org/ghc;
-    description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
-    inherit (ghc.meta) license platforms;
-  };
-
-}
diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix
deleted file mode 100644
index f7422d150ac0..000000000000
--- a/pkgs/development/compilers/ghc/8.0.2.nix
+++ /dev/null
@@ -1,201 +0,0 @@
-{ stdenv, targetPackages
-
-# build-tools
-, bootPkgs
-, coreutils, fetchpatch, fetchurl, perl, sphinx
-
-, libiconv ? null, ncurses
-
-, useLLVM ? !stdenv.targetPlatform.isx86
-, # LLVM is conceptually a run-time-only depedendency, but for
-  # non-x86, we need LLVM to bootstrap later stages, so it becomes a
-  # build-time dependency too.
-  buildLlvmPackages, llvmPackages
-
-, # If enabled, GHC will be built with the GPL-free but slower integer-simple
-  # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
-
-, # If enabled, use -fPIC when compiling static libs.
-  enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
-
-, # Whether to build dynamic libs for the standard library (on the target
-  # platform). Static libs are always built.
-  enableShared ? true
-
-, # What flavour to build. An empty string indicates no
-  # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
-}:
-
-assert !enableIntegerSimple -> gmp != null;
-
-let
-  inherit (stdenv) buildPlatform hostPlatform targetPlatform;
-
-  inherit (bootPkgs) ghc;
-
-  # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
-    (targetPlatform != hostPlatform)
-    "${targetPlatform.config}-";
-
-  buildMK = ''
-    BuildFlavour = ${ghcFlavour}
-    ifneq \"\$(BuildFlavour)\" \"\"
-    include mk/flavours/\$(BuildFlavour).mk
-    endif
-    DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
-    INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
-    Stage1Only = YES
-    HADDOCK_DOCS = NO
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
-    GhcLibHcOpts += -fPIC
-    GhcRtsHcOpts += -fPIC
-  '';
-
-  # Splicer will pull out correct variations
-  libDeps = platform: [ ncurses ]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc") libiconv;
-
-  toolsForTarget =
-    if hostPlatform == buildPlatform then
-      [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm
-    else assert targetPlatform == hostPlatform; # build != host == target
-      [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
-
-  targetCC = builtins.head toolsForTarget;
-
-in
-stdenv.mkDerivation rec {
-  version = "8.0.2";
-  name = "${targetPrefix}ghc-${version}";
-
-  src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi";
-  };
-
-  enableParallelBuilding = true;
-
-  outputs = [ "out" "man" "doc" ];
-
-  patches = [
-    ./ghc-gold-linker.patch
-    (fetchpatch { # Unreleased 1.24.x commit
-      url = "https://github.com/haskell/cabal/commit/6394cb0b6eba91a8692a3d04b2b56935aed7cccd.patch";
-      sha256 = "14xxjg0nb1j1pw0riac3v385ka92qhxxblfmwyvbghz7kry6axy0";
-      stripLen = 1;
-      extraPrefix = "libraries/Cabal/";
-    })
-  ] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
-    ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch
-    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
-
-  postPatch = "patchShebangs .";
-
-  # GHC is a bit confused on its cross terminology.
-  preConfigure = ''
-    for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
-      export "''${env#TARGET_}=''${!env}"
-    done
-    # GHC is a bit confused on its cross terminology, as these would normally be
-    # the *host* tools.
-    export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
-    export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
-    export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
-    export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
-    export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
-    export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
-    export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
-    export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
-
-    echo -n "${buildMK}" > mk/build.mk
-    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-    export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '';
-
-  # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
-  # `--with` flags for libraries needed for RTS linker
-  configureFlags = [
-    "--datadir=$doc/share/doc/ghc"
-    "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
-    "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [
-    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
-    "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
-    # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    "--disable-large-address-space"
-  ];
-
-  # Make sure we never relax`$PATH` and hooks support for compatability.
-  strictDeps = true;
-
-  nativeBuildInputs = [
-    perl sphinx
-    ghc bootPkgs.hscolour
-  ];
-
-  # For building runtime libs
-  depsBuildTarget = toolsForTarget;
-
-  buildInputs = libDeps hostPlatform;
-
-  propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
-
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
-
-  # required, because otherwise all symbols from HSffi.o are stripped, and
-  # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
-
-  hardeningDisable = [ "format" ];
-
-  postInstall = ''
-    for bin in "$out"/lib/${name}/bin/*; do
-      isELF "$bin" || continue
-      paxmark m "$bin"
-    done
-
-    # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
-
-    # Patch scripts to include "readelf" and "cat" in $PATH.
-    for i in "$out/bin/"*; do
-      test ! -h $i || continue
-      egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
-    done
-  '';
-
-  passthru = {
-    inherit bootPkgs targetPrefix;
-
-    inherit llvmPackages;
-    inherit enableShared;
-
-    # Our Cabal compiler name
-    haskellCompilerName = "ghc-8.0.2";
-  };
-
-  meta = {
-    homepage = http://haskell.org/ghc;
-    description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
-    inherit (ghc.meta) license platforms;
-  };
-
-}
diff --git a/pkgs/development/compilers/ghc/8.2.1-binary.nix b/pkgs/development/compilers/ghc/8.2.1-binary.nix
index 6caeaf20f64c..626c0d8ca9c2 100644
--- a/pkgs/development/compilers/ghc/8.2.1-binary.nix
+++ b/pkgs/development/compilers/ghc/8.2.1-binary.nix
@@ -75,6 +75,7 @@ stdenv.mkDerivation rec {
     # Some scripts used during the build need to have their shebangs patched
     ''
       patchShebangs ghc-${version}/utils/
+      patchShebangs ghc-${version}/configure
     '' +
 
     # Strip is harmful, see also below. It's important that this happens
diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.6.2.nix
index e43f9a57d0a4..6470f7b02957 100644
--- a/pkgs/development/compilers/ghc/8.4.3.nix
+++ b/pkgs/development/compilers/ghc/8.6.2.nix
@@ -29,10 +29,6 @@
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
   ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
-, # Whether to backport https://phabricator.haskell.org/D4388 for
-  # deterministic profiling symbol names, at the cost of a slightly
-  # non-standard GHC API
-  deterministicProfiling ? false
 }:
 
 assert !enableIntegerSimple -> gmp != null;
@@ -82,34 +78,23 @@ let
 
 in
 stdenv.mkDerivation (rec {
-  version = "8.4.3";
+  version = "8.6.2";
   name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
     url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1mk046vb561j75saz05rghhbkps46ym5aci4264dwc2qk3dayixf";
+    sha256 = "1mbn3n2ynmpfpb7jfnhpzzli31qqxqyi8ws71blws3i846fq3ana";
   };
 
   enableParallelBuilding = true;
 
   outputs = [ "out" "doc" ];
 
-  patches = [(fetchpatch {
-    url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf";
-    sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
-    extraPrefix = "utils/hsc2hs/";
-    stripLen = 1;
-  }) (fetchpatch rec { # https://phabricator.haskell.org/D5123
+  patches = [(fetchpatch rec { # https://phabricator.haskell.org/D5123
     url = "http://tarballs.nixos.org/sha256/${sha256}";
     name = "D5123.diff";
     sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
-  })] ++ stdenv.lib.optional deterministicProfiling
-    (fetchpatch rec {
-      url = "http://tarballs.nixos.org/sha256/${sha256}";
-      name = "D4388.diff";
-      sha256 = "0w6sdcvnqjlnlzpvnzw20b80v150ijjyjvs9548ildc1928j0w7s";
-    })
-    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
+  })];
 
   postPatch = "patchShebangs .";
 
@@ -230,7 +215,7 @@ stdenv.mkDerivation (rec {
     inherit enableShared;
 
     # Our Cabal compiler name
-    haskellCompilerName = "ghc-8.4.3";
+    haskellCompilerName = "ghc-8.6.2";
   };
 
   meta = {
diff --git a/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch b/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch
deleted file mode 100644
index 90224df19f61..000000000000
--- a/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- b/includes/rts/storage/ClosureMacros.h        2017-05-21 12:54:09.000000000 +0200
-+++ a/includes/rts/storage/ClosureMacros.h        2017-05-21 12:55:57.000000000 +0200
-@@ -499,8 +499,17 @@
-
-    -------------------------------------------------------------------------- */
-
--#define ZERO_SLOP_FOR_LDV_PROF     (defined(PROFILING))
--#define ZERO_SLOP_FOR_SANITY_CHECK (defined(DEBUG) && !defined(THREADED_RTS))
-+#if defined(PROFILING)
-+#define ZERO_SLOP_FOR_LDV_PROF 1
-+#else
-+#define ZERO_SLOP_FOR_LDV_PROF 0
-+#endif
-+
-+#if defined(DEBUG) && !defined(THREADED_RTS)
-+#define ZERO_SLOP_FOR_SANITY_CHECK 1
-+#else
-+#define ZERO_SLOP_FOR_SANITY_CHECK 0
-+#endif
-
- #if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK
- #define OVERWRITING_CLOSURE(c) overwritingClosure(c)
-
diff --git a/pkgs/development/compilers/ghc/ghc-gold-linker.patch b/pkgs/development/compilers/ghc/ghc-gold-linker.patch
deleted file mode 100644
index edce7ef3a178..000000000000
--- a/pkgs/development/compilers/ghc/ghc-gold-linker.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 46fe80ab7c0013a929d0934e61429820042a70a9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me>
-Date: Fri, 21 Jul 2017 20:09:11 +0200
-Subject: [PATCH 1/2] base: Add `extra-libraries: m` because base uses libm
- functions.
-
-Linking with gold needs this because in contrast to ld, gold
-doesn't implicitly link libm.
-
-Found by Michael Bishop <cleverca22@gmail.com>.
----
- libraries/base/base.cabal | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal
-index f00fb8768e5..fd91f268ffe 100644
---- a/libraries/base/base.cabal
-+++ b/libraries/base/base.cabal
-@@ -342,6 +342,10 @@ Library
-         WCsubst.h
-         consUtils.h
- 
-+    -- Base uses libm functions. ld.bfd links libm implicitly when necessary.
-+    -- Other linkers, like gold, don't, so we have to declare it explicitly.
-+    extra-libraries: m
-+
-     -- OS Specific
-     if os(windows)
-         -- Windows requires some extra libraries for linking because the RTS
-
-From 900a8f4931e9bc6d3219d9263cfecfc6af8fc766 Mon Sep 17 00:00:00 2001
-From: michael bishop <cleverca22@gmail.com>
-Date: Sat, 22 Jul 2017 13:12:39 -0300
-Subject: [PATCH 2/2] also add -lm to ghc-prim
-
----
- libraries/ghc-prim/ghc-prim.cabal | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
-index 00a029efedf..6db85dd69fc 100644
---- a/libraries/ghc-prim/ghc-prim.cabal
-+++ b/libraries/ghc-prim/ghc-prim.cabal
-@@ -42,6 +42,10 @@ Library
-         UnliftedFFITypes
- 
-     build-depends: rts == 1.0.*
-+    
-+    -- Base uses libm functions. ld.bfd links libm implicitly when necessary.
-+    -- Other linkers, like gold, don't, so we have to declare it explicitly.
-+    extra-libraries: m
- 
-     exposed-modules:
-         GHC.CString
diff --git a/pkgs/development/compilers/ghc/ghc-no-madv-free.patch b/pkgs/development/compilers/ghc/ghc-no-madv-free.patch
deleted file mode 100644
index 8fea9f920126..000000000000
--- a/pkgs/development/compilers/ghc/ghc-no-madv-free.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
-index 99620ee..e052a84 100644
---- a/rts/posix/OSMem.c
-+++ b/rts/posix/OSMem.c
-@@ -523,13 +523,7 @@ void osDecommitMemory(void *at, W_ size)
-         sysErrorBelch("unable to make released memory unaccessible");
- #endif
- 
--#ifdef MADV_FREE
--    // Try MADV_FREE first, FreeBSD has both and MADV_DONTNEED
--    // just swaps memory out
--    r = madvise(at, size, MADV_FREE);
--#else
-     r = madvise(at, size, MADV_DONTNEED);
--#endif
-     if(r < 0)
-         sysErrorBelch("unable to decommit memory");
- }
diff --git a/pkgs/development/compilers/ghc/relocation.patch b/pkgs/development/compilers/ghc/relocation.patch
deleted file mode 100644
index b9becfc86b54..000000000000
--- a/pkgs/development/compilers/ghc/relocation.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Adding support for the R_X86_64_REX_GOTPCRELX relocation type. 
-This relocation is treated by the linker the same as the R_X86_64_GOTPCRELX type
-G + GOT + A - P to generate relative offsets to the GOT.
-The REX prefix has no influence in this stage.
-
-This caused breakage when enabling relro/bindnow hardening e.g. in ghcPaclages.vector
-
-Source: https://phabricator.haskell.org/D2303#67070
-diff --git a/rts/Linker.c b/rts/Linker.c
---- a/rts/Linker.c
-+++ b/rts/Linker.c
-@@ -5681,7 +5681,13 @@
-           *(Elf64_Sword *)P = (Elf64_Sword)value;
- #endif
-           break;
--
-+/* These two relocations were introduced in glibc 2.23 and binutils 2.26.
-+    But in order to use them the system which compiles the bindist for GHC needs
-+    to have glibc >= 2.23. So only use them if they're defined. */
-+#if defined(R_X86_64_REX_GOTPCRELX) && defined(R_X86_64_GOTPCRELX)
-+      case R_X86_64_REX_GOTPCRELX:
-+      case R_X86_64_GOTPCRELX:
-+#endif
-       case R_X86_64_GOTPCREL:
-       {
-           StgInt64 gotAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)->addr;
-