about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-10 07:13:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-12 14:07:16 +0000
commite2698550456abba83c6dcd5d5e5a9990a0b96f8a (patch)
tree79a56f0df3fa55e470d84b4dff6059fbf487ec18 /nixpkgs/pkgs/development/compilers/ghc
parent1cdc42df888dc98c347e03bd942ed9825a55bcb3 (diff)
parent84d74ae9c9cbed73274b8e4e00be14688ffc93fe (diff)
downloadnixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.gz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.bz2
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.lz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.xz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.zst
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.zip
Merge commit '84d74ae9c9cbed73274b8e4e00be14688ffc93fe'
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/ghc')
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix29
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix174
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix (renamed from nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix)74
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix11
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix24
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix27
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix257
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/head.nix38
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/issue-18549.patch296
10 files changed, 855 insertions, 93 deletions
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix
index c70efe1fdef3..d3835d01e5a2 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix
@@ -23,6 +23,9 @@
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
 
+  # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64
+
 , # Whether to build dynamic libs for the standard library (on the target
   # platform). Static libs are always built.
   enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
@@ -52,19 +55,30 @@ let
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
-  buildMK = ''
+  buildMK = dontStrip: ''
     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 = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+  ''
+    # We only need to build stage1 on most cross-compilation because
+    # we will be running the compiler on the native system. In some
+    # situations, like native Musl compilation, we need the compiler
+    # to actually link to our new Libc. The iOS simulator is a special
+    # exception because we can’t actually run simulators binaries
+    # ourselves.
+  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString dontStrip ''
+    STRIP_CMD = :
+  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+    GhcLibWays = "v dyn"
   '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
@@ -94,7 +108,7 @@ stdenv.mkDerivation (rec {
   name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
-    url = "https://downloads.haskell.org/ghc/8.10.1/ghc-${version}-src.tar.xz";
+    url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
     sha256 = "1xgdl6ig5jzli3bg054vfryfkg0y6wggf68g66c32sr67bw0ffsf";
   };
 
@@ -122,7 +136,7 @@ stdenv.mkDerivation (rec {
     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
+    echo -n "${buildMK dontStrip}" > 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}"
@@ -235,8 +249,9 @@ stdenv.mkDerivation (rec {
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
-  dontStrip = true;
+  dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
+
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix
new file mode 100644
index 000000000000..baa1d879b53e
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix
@@ -0,0 +1,174 @@
+{ stdenv
+, fetchurl, perl, gcc
+, ncurses6, gmp, glibc, libiconv, numactl
+, llvmPackages
+}:
+
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
+let
+  useLLVM = !stdenv.targetPlatform.isx86;
+
+  libPath = stdenv.lib.makeLibraryPath ([
+    ncurses6 gmp
+  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv
+    ++ stdenv.lib.optional (stdenv.hostPlatform.isAarch64) numactl);
+
+  libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+    + "LD_LIBRARY_PATH";
+
+  glibcDynLinker = assert stdenv.isLinux;
+    if stdenv.hostPlatform.libc == "glibc" then
+       # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
+       ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
+    else
+      "${stdenv.lib.getLib glibc}/lib/ld-linux*";
+
+in
+
+stdenv.mkDerivation rec {
+  version = "8.10.2";
+
+  name = "ghc-${version}-binary";
+
+  # https://downloads.haskell.org/~ghc/8.10.2/
+  src = fetchurl ({
+    i686-linux = {
+      url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-deb9-linux.tar.xz";
+      sha256 = "0bvwisl4w0z5z8z0da10m9sv0mhm9na2qm43qxr8zl23mn32mblx";
+    };
+    x86_64-linux = {
+      url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-deb10-linux.tar.xz";
+      sha256 = "0chnzy9j23b2wa8clx5arwz8wnjfxyjmz9qkj548z14cqf13slcl";
+    };
+    armv7l-linux = {
+      url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-armv7-deb10-linux.tar.xz";
+      sha256 = "1j41cq5d3rmlgz7hzw8f908fs79gc5mn3q5wz277lk8zdf19g75v";
+    };
+    aarch64-linux = {
+      url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-aarch64-deb10-linux.tar.xz";
+      sha256 = "14smwl3741ixnbgi0l51a7kh7xjkiannfqx15b72svky0y4l3wjw";
+    };
+    x86_64-darwin = {
+      url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz";
+      sha256 = "1hngyq14l4f950hzhh2d204ca2gfc98pc9xdasxihzqd1jq75dzd";
+    };
+  }.${stdenv.hostPlatform.system}
+    or (throw "cannot bootstrap GHC on this platform"));
+
+  nativeBuildInputs = [ perl ];
+  propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ];
+
+  # Cannot patchelf beforehand due to relative RPATHs that anticipate
+  # the final install location/
+  ${libEnvVar} = libPath;
+
+  postUnpack =
+    # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
+    # during linking
+    stdenv.lib.optionalString stdenv.isDarwin ''
+      export NIX_LDFLAGS+=" -no_dtrace_dof"
+      # not enough room in the object files for the full path to libiconv :(
+      for exe in $(find . -type f -executable); do
+        isScript $exe && continue
+        ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
+        install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib -change /usr/local/lib/gcc/6/libgcc_s.1.dylib ${gcc.cc.lib}/lib/libgcc_s.1.dylib $exe
+      done
+    '' +
+
+    # Some scripts used during the build need to have their shebangs patched
+    ''
+      patchShebangs ghc-${version}/utils/
+      patchShebangs ghc-${version}/configure
+    '' +
+
+    # We have to patch the GMP paths for the integer-gmp package.
+    ''
+      find . -name integer-gmp.buildinfo \
+          -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
+    '' + stdenv.lib.optionalString stdenv.isDarwin ''
+      find . -name base.buildinfo \
+          -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
+    '' +
+    # Rename needed libraries and binaries, fix interpreter
+    stdenv.lib.optionalString stdenv.isLinux ''
+      find . -type f -perm -0100 -exec patchelf \
+          --replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.6 libncurses.so \
+          --interpreter ${glibcDynLinker} {} \;
+
+      sed -i "s|/usr/bin/perl|perl\x00        |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
+      sed -i "s|/usr/bin/gcc|gcc\x00        |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
+    '' +
+    # We're kludging a glibc bindist into working with non-glibc...
+    # Here we patch up the use of `__strdup` (part of glibc binary ABI)
+    # to instead use `strdup` since musl doesn't provide __strdup
+    # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
+    # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
+    # Use objcopy magic to make the change:
+    stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+      find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
+    '';
+
+  # fix for `configure: error: Your linker is affected by binutils #16177`
+  preConfigure = stdenv.lib.optionalString
+    stdenv.targetPlatform.isAarch32
+    "LD=ld.gold";
+
+  configurePlatforms = [ ];
+  configureFlags = [
+    "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
+    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
+  ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
+
+  # No building is necessary, but calling make without flags ironically
+  # calls install-strip ...
+  dontBuild = true;
+
+  # On Linux, use patchelf to modify the executables so that they can
+  # find editline/gmp.
+  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+    for p in $(find "$out" -type f -executable); do
+      if isELF "$p"; then
+        echo "Patchelfing $p"
+        patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
+      fi
+    done
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    # not enough room in the object files for the full path to libiconv :(
+    for exe in $(find "$out" -type f -executable); do
+      isScript $exe && continue
+      ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
+      install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib -change /usr/local/lib/gcc/6/libgcc_s.1.dylib ${gcc.cc.lib}/lib/libgcc_s.1.dylib $exe
+    done
+
+    for file in $(find "$out" -name setup-config); do
+      substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
+    done
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    unset ${libEnvVar}
+    # Sanity check, can ghc create executables?
+    cd $TMP
+    mkdir test-ghc; cd test-ghc
+    cat > main.hs << EOF
+      {-# LANGUAGE TemplateHaskell #-}
+      module Main where
+      main = putStrLn \$([|"yes"|])
+    EOF
+    $out/bin/ghc --make main.hs || exit 1
+    echo compilation ok
+    [ $(./main) == "yes" ]
+  '';
+
+  passthru = {
+    targetPrefix = "";
+    enableShared = true;
+  };
+
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
+}
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix
index a4174c47046e..f3d64ced81ee 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix
@@ -2,12 +2,15 @@
 
 # build-tools
 , bootPkgs
-, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4, sphinx
+, autoconf, automake, coreutils, fetchurl, perl, python3, m4, sphinx
 , bash
 
 , libiconv ? null, ncurses
 
-, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) || stdenv.targetPlatform.isiOS
+, # GHC can be built with system libffi or a bundled one.
+  libffi ? null
+
+, 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.
@@ -20,6 +23,9 @@
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
 
+  # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64
+
 , # Whether to build dynamic libs for the standard library (on the target
   # platform). Static libs are always built.
   enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
@@ -29,11 +35,12 @@
 
 , # 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
+  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+    (if useLLVM then "perf-cross" else "perf-cross-ncg")
+
+, # Whether to disable the large address space allocator
+  # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
+  disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
 }:
 
 assert !enableIntegerSimple -> gmp != null;
@@ -61,6 +68,8 @@ let
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+    GhcLibWays = "v dyn"
   '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
@@ -70,6 +79,7 @@ let
 
   # Splicer will pull out correct variations
   libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+    ++ [libffi]
     ++ stdenv.lib.optional (!enableIntegerSimple) gmp
     ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
@@ -85,38 +95,22 @@ let
 
 in
 stdenv.mkDerivation (rec {
-  version = "8.4.4";
+  version = "8.10.2";
   name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
     url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
-    sha256 = "1ch4j2asg7pr52ai1hwzykxyj553wndg7wq93i47ql4fllspf48i";
+    sha256 = "02w8n085bw38vyp694j0lfk5wcnwkdaj7hhp0saj71x74533lmww";
   };
 
   enableParallelBuilding = true;
 
   outputs = [ "out" "doc" ];
 
-  patches = [(fetchpatch {
-    url = "https://github.com/haskell/hsc2hs/commit/738f3666c878ee9e79c3d5e819ef8b3460288edf.diff";
-    sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
-    extraPrefix = "utils/hsc2hs/";
-    stripLen = 1;
-  }) (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
-    ++ stdenv.lib.optional (targetPlatform.isAarch32 || targetPlatform.isAarch64) (fetchpatch {
-      url = "https://github.com/ghc/ghc/commit/d8495549ba9d194815c2d0eaee6797fc7c00756a.diff";
-      sha256 = "1yjcma507c609bcim4rnxq0gaj2dg4d001jklmbpbqpzqzxkn5sz";
-    });
+  # https://gitlab.haskell.org/ghc/ghc/-/issues/18549 
+  patches = [ 
+    ./issue-18549.patch 
+  ];
 
   postPatch = "patchShebangs .";
 
@@ -167,22 +161,28 @@ stdenv.mkDerivation (rec {
   # 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.optionals (libffi != null) [
+    "--with-system-libffi"
+    "--with-ffi-includes=${targetPackages.libffi.dev}/include"
+    "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
   ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
-    "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
+    "--with-gmp-includes=${targetPackages.gmp.dev}/include"
+    "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
   ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
-    "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
+    "--with-iconv-includes=${libiconv}/include"
+    "--with-iconv-libraries=${libiconv}/lib"
   ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
   ] ++ stdenv.lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ 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/
+  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -190,7 +190,7 @@ stdenv.mkDerivation (rec {
   strictDeps = true;
 
   # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
-  dontAddExtraLibs = true;
+	dontAddExtraLibs = true;
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3 sphinx
@@ -212,10 +212,6 @@ stdenv.mkDerivation (rec {
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
-  # See #63511 - the only unstripped file is the debug rts which isn't meant to
-  # be stripped.
-  dontStrip = true;
-
   checkTarget = "test";
 
   hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
@@ -239,7 +235,7 @@ stdenv.mkDerivation (rec {
     inherit enableShared;
 
     # Our Cabal compiler name
-    haskellCompilerName = "ghc-8.4.4";
+    haskellCompilerName = "ghc-${version}";
   };
 
   meta = {
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix b/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix
index 97793d912895..41af279e83ff 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix
@@ -78,18 +78,6 @@ stdenv.mkDerivation rec {
       patchShebangs ghc-${version}/configure
     '' +
 
-    # Strip is harmful, see also below. It's important that this happens
-    # first. The GHC Cabal build system makes use of strip by default and
-    # has hardcoded paths to /usr/bin/strip in many places. We replace
-    # those below, making them point to our dummy script.
-    ''
-      mkdir "$TMP/bin"
-      for i in strip; do
-        echo '#! ${stdenv.shell}' > "$TMP/bin/$i"
-        chmod +x "$TMP/bin/$i"
-      done
-      PATH="$TMP/bin:$PATH"
-    '' +
     # We have to patch the GMP paths for the integer-gmp package.
     ''
       find . -name integer-gmp.buildinfo \
@@ -125,17 +113,13 @@ stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
     ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
 
-  # Stripping combined with patchelf breaks the executables (they die
-  # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
-  dontStrip = true;
-
   # No building is necessary, but calling make without flags ironically
   # calls install-strip ...
   dontBuild = true;
 
   # On Linux, use patchelf to modify the executables so that they can
   # find editline/gmp.
-  preFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
     for p in $(find "$out" -type f -executable); do
       if isELF "$p"; then
         echo "Patchelfing $p"
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix b/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix
index 06266556cf33..a5d2bb5c88d6 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix
@@ -59,8 +59,15 @@ let
     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 = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+  ''
+    # We only need to build stage1 on most cross-compilation because
+    # we will be running the compiler on the native system. In some
+    # situations, like native Musl compilation, we need the compiler
+    # to actually link to our new Libc. The iOS simulator is a special
+    # exception because we can’t actually run simulators binaries
+    # ourselves.
+  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix
index 305226b34079..371a369496ee 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix
@@ -52,19 +52,28 @@ let
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
-  buildMK = ''
+  buildMK = dontStrip: ''
     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 = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+  ''
+    # We only need to build stage1 on most cross-compilation because
+    # we will be running the compiler on the native system. In some
+    # situations, like native Musl compilation, we need the compiler
+    # to actually link to our new Libc. The iOS simulator is a special
+    # exception because we can’t actually run simulators binaries
+    # ourselves.
+  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString dontStrip ''
+    STRIP_CMD = :
   '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
@@ -94,7 +103,7 @@ stdenv.mkDerivation (rec {
   name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
-    url = "https://downloads.haskell.org/ghc/8.8.2/ghc-${version}-src.tar.xz";
+    url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
     sha256 = "02qa6wgjpxgakg7hv4zfdlrx9k7zxa5i02wnr6y9fsv8j16sbkh1";
   };
 
@@ -122,7 +131,7 @@ stdenv.mkDerivation (rec {
     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
+    echo -n "${buildMK dontStrip}" > 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}"
@@ -235,8 +244,9 @@ stdenv.mkDerivation (rec {
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
-  dontStrip = true;
+  dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
+
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
index b199dc34fa37..e26eacca204b 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
@@ -23,6 +23,9 @@
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
 
+  # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64
+
 , # Whether to build dynamic libs for the standard library (on the target
   # platform). Static libs are always built.
   enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
@@ -52,19 +55,30 @@ let
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
-  buildMK = ''
+  buildMK = dontStrip: ''
     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 = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+  ''
+    # We only need to build stage1 on most cross-compilation because
+    # we will be running the compiler on the native system. In some
+    # situations, like native Musl compilation, we need the compiler
+    # to actually link to our new Libc. The iOS simulator is a special
+    # exception because we can’t actually run simulators binaries
+    # ourselves.
+  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString dontStrip ''
+    STRIP_CMD = :
+  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+    GhcLibWays = "v dyn"
   '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
@@ -122,7 +136,7 @@ stdenv.mkDerivation (rec {
     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
+    echo -n "${buildMK dontStrip}" > 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}"
@@ -235,8 +249,9 @@ stdenv.mkDerivation (rec {
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
-  dontStrip = true;
+  dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
+
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix
new file mode 100644
index 000000000000..22a9e6e25f9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix
@@ -0,0 +1,257 @@
+{ stdenv, pkgsBuildTarget, targetPackages
+
+# build-tools
+, bootPkgs
+, autoconf, automake, coreutils, fetchurl, perl, python3, m4, sphinx
+, bash
+
+, libiconv ? null, ncurses
+
+, # GHC can be built with system libffi or a bundled one.
+  libffi ? null
+
+, 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
+
+  # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64
+
+, # Whether to build dynamic libs for the standard library (on the target
+  # platform). Static libs are always built.
+  enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
+
+, # Whether to build terminfo.
+  enableTerminfo ? !stdenv.targetPlatform.isWindows
+
+, # 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)
+    (if useLLVM then "perf-cross" else "perf-cross-ncg")
+
+, # Whether to disable the large address space allocator
+  # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
+  disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
+}:
+
+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 = dontStrip: ''
+    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"}
+  ''
+    # We only need to build stage1 on most cross-compilation because
+    # we will be running the compiler on the native system. In some
+    # situations, like native Musl compilation, we need the compiler
+    # to actually link to our new Libc. The iOS simulator is a special
+    # exception because we can’t actually run simulators binaries
+    # ourselves.
+  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
+    CrossCompilePrefix = ${targetPrefix}
+    HADDOCK_DOCS = NO
+    BUILD_SPHINX_HTML = NO
+    BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString dontStrip ''
+    STRIP_CMD = :
+  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+    GhcLibWays = "v dyn"
+  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+    GhcLibHcOpts += -fPIC
+    GhcRtsHcOpts += -fPIC
+  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+    EXTRA_CC_OPTS += -std=gnu99
+  '';
+
+  # Splicer will pull out correct variations
+  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+    ++ [libffi]
+    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
+    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+
+  toolsForTarget = [
+    pkgsBuildTarget.targetPackages.stdenv.cc
+  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+
+  targetCC = builtins.head toolsForTarget;
+
+  # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856
+  # see #84670 and #49071 for more background.
+  useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
+
+in
+stdenv.mkDerivation (rec {
+  version = "8.8.4";
+  name = "${targetPrefix}ghc-${version}";
+
+  src = fetchurl {
+    url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
+    sha256 = "0bgwbxxvdn56l91bp9p5d083gzcfdi6z8l8b17qzjpr3n8w5wl7h";
+  };
+
+  enableParallelBuilding = true;
+
+  outputs = [ "out" "doc" ];
+
+  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"
+    # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    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 dontStrip}" > 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"
+  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+    sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
+  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+      echo "patching llvm-targets for musl targets..."
+      echo "Cloning these existing '*-linux-gnu*' targets:"
+      grep linux-gnu llvm-targets | sed 's/^/  /'
+      echo "(go go gadget sed)"
+      sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
+      echo "llvm-targets now contains these '*-linux-musl*' targets:"
+      grep linux-musl llvm-targets | sed 's/^/  /'
+
+      echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
+      # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
+      for x in configure aclocal.m4; do
+        substituteInPlace $x \
+          --replace '*-android*|*-gnueabi*)' \
+                    '*-android*|*-gnueabi*|*-musleabi*)'
+      done
+  '';
+
+  # 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.optionals (libffi != null) [
+    "--with-system-libffi"
+    "--with-ffi-includes=${targetPackages.libffi.dev}/include"
+    "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
+  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+    "--with-gmp-includes=${targetPackages.gmp.dev}/include"
+    "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
+  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+    "--with-iconv-includes=${libiconv}/include"
+    "--with-iconv-libraries=${libiconv}/lib"
+  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+    "--enable-bootstrap-with-devel-snapshot"
+  ] ++ stdenv.lib.optionals useLdGold [
+    "CFLAGS=-fuse-ld=gold"
+    "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
+    "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
+  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+    "--disable-large-address-space"
+  ];
+
+  # Make sure we never relax`$PATH` and hooks support for compatibility.
+  strictDeps = true;
+
+  # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
+	dontAddExtraLibs = true;
+
+  nativeBuildInputs = [
+    perl autoconf automake m4 python3 sphinx
+    ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
+  ];
+
+  # For building runtime libs
+  depsBuildTarget = toolsForTarget;
+
+  buildInputs = [ perl bash ] ++ (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";
+
+  checkTarget = "test";
+
+  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+
+  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-${version}";
+  };
+
+  meta = {
+    homepage = "http://haskell.org/ghc";
+    description = "The Glasgow Haskell Compiler";
+    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    inherit (ghc.meta) license platforms;
+  };
+
+  dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
+
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
+  dontPatchELF = true;
+  noAuditTmpdir = true;
+})
diff --git a/nixpkgs/pkgs/development/compilers/ghc/head.nix b/nixpkgs/pkgs/development/compilers/ghc/head.nix
index a15ef7f7dbf8..6f9f577743f5 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/head.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/head.nix
@@ -20,14 +20,17 @@
   # 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)
+, # If enabled, GHC will be built with the GPL-free but slightly slower native
+  # bignum backend instead of the faster but GPLed gmp backend.
+  enableNativeBignum ? !(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
 
+  # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64
+
 , # Whether to build dynamic libs for the standard library (on the target
   # platform). Static libs are always built.
   enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
@@ -35,7 +38,7 @@
 , # Whether to build terminfo.
   enableTerminfo ? !stdenv.targetPlatform.isWindows
 
-, version ? "8.11.20200505"
+, version ? "8.11.20200824"
 , # 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)
@@ -46,7 +49,7 @@
   disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
 }:
 
-assert !enableIntegerSimple -> gmp != null;
+assert !enableNativeBignum -> gmp != null;
 
 let
   inherit (stdenv) buildPlatform hostPlatform targetPlatform;
@@ -58,19 +61,23 @@ let
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
-  buildMK = ''
+  buildMK = dontStrip: ''
     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"}
+    BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"}
   '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
-    Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+    Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString dontStrip ''
+    STRIP_CMD = :
+  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+    GhcLibWays = "v dyn"
   '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
@@ -81,7 +88,7 @@ let
   # Splicer will pull out correct variations
   libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
+    ++ stdenv.lib.optional (!enableNativeBignum) gmp
     ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
     ++ stdenv.lib.optional enableDwarf elfutils;
 
@@ -103,8 +110,8 @@ stdenv.mkDerivation (rec {
 
   src = fetchgit {
     url = "https://gitlab.haskell.org/ghc/ghc.git/";
-    rev = "40c71c2cf38b4e134d81b7184a4d5e02949ae70c";
-    sha256 = "04h9rcyzm9w3an1z00hjs062dp7dl19b8pkyxjsypr7a2i9dmvkb";
+    rev = "3f50154591ada9064351ccec4adfe6df53ca2439";
+    sha256 = "1w2p5bc74aswspzvgvrhcb95hvj5ky38rgqqjvrri19z2qyiky6d";
   };
 
   enableParallelBuilding = true;
@@ -132,7 +139,7 @@ stdenv.mkDerivation (rec {
     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
+    echo -n "${buildMK dontStrip}" > mk/build.mk
     echo ${version} > VERSION
     echo ${src.rev} > GIT_COMMIT_ID
     ./boot
@@ -173,7 +180,7 @@ stdenv.mkDerivation (rec {
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
   ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
@@ -251,8 +258,9 @@ stdenv.mkDerivation (rec {
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
-  dontStrip = true;
+  dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
+
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/issue-18549.patch b/nixpkgs/pkgs/development/compilers/ghc/issue-18549.patch
new file mode 100644
index 000000000000..eb30d9d9dd4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/ghc/issue-18549.patch
@@ -0,0 +1,296 @@
+From fac083e7ac8a37b61a4082bbbca2848e52fd1bb2 Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben@smart-cactus.org>
+Date: Sun, 9 Aug 2020 09:15:16 -0400
+Subject: [PATCH] Revert "[linker/rtsSymbols] More linker symbols"
+
+This reverts commit aa2e5863699306920513b216f337de09e29b5bb8.
+---
+ rts/RtsSymbols.c | 224 ++++-------------------------------------------
+ 1 file changed, 17 insertions(+), 207 deletions(-)
+
+diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
+index d10a6900db..b2f90a892d 100644
+--- a/rts/RtsSymbols.c
++++ b/rts/RtsSymbols.c
+@@ -58,6 +58,7 @@
+       SymI_HasProto(signal_handlers)            \
+       SymI_HasProto(stg_sig_install)            \
+       SymI_HasProto(rtsTimerSignal)             \
++      SymI_HasProto(atexit)                     \
+       SymI_NeedsDataProto(nocldstop)
+ #endif
+ 
+@@ -976,213 +977,29 @@
+       RTS_USER_SIGNALS_SYMBOLS                                          \
+       RTS_INTCHAR_SYMBOLS
+ 
++
+ // 64-bit support functions in libgcc.a
+-// See https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc
+-#define RTS_LIBGCC_SYMBOLS_32                          \
+-      SymI_NeedsProto(__fixunsdfdi)                    \
+-      /* 4 The GCC low-level runtime library         */\
+-      /* 4.1.1 Arithmetic functions                  */\
+-      /* SymI_NeedsProto(__ashlsi3) */\
+-      SymI_NeedsProto(__ashldi3) \
+-      /* SymI_NeedsProto(__ashlti3) */\
+-      /* These functions return the result of shifting a left by b bits. */\
+-      /* SymI_NeedsProto(__ashrsi3) */\
+-      SymI_NeedsProto(__ashrdi3) \
+-      /* SymI_NeedsProto(__ashrti3) */\
+-      /* These functions return the result of arithmetically shifting a right by b bits. */\
+-      /* SymI_NeedsProto(__divsi3) */\
+-      SymI_NeedsProto(__divdi3) \
+-      /* SymI_NeedsProto(__divti3) */\
+-      /* These functions return the quotient of the signed division of a and b. */\
+-      /* SymI_NeedsProto(__lshrsi3) */ \
+-      SymI_NeedsProto(__lshrdi3) \
+-      /* SymI_NeedsProto(__lshrti3) */ \
+-      /* These functions return the result of logically shifting a right by b bits. */\
+-      /* SymI_NeedsProto(__modsi3) */ \
+-      SymI_NeedsProto(__moddi3) \
+-      /* SymI_NeedsProto(__modti3) */ \
+-      /* These functions return the remainder of the signed division of a and b. */\
+-      /* SymI_NeedsProto(__mulsi3) */ \
+-      SymI_NeedsProto(__muldi3) \
+-      /* SymI_NeedsProto(__multi3) */ \
+-      /* These functions return the product of a and b. */\
+-      SymI_NeedsProto(__negdi2) \
+-      /* SymI_NeedsProto(__negti2) */ \
+-      /* These functions return the negation of a. */\
+-      /* SymI_NeedsProto(__udivsi3) */ \
+-      SymI_NeedsProto(__udivdi3) \
+-      /* SymI_NeedsProto(__udivti3) */ \
+-      /* These functions return the quotient of the unsigned division of a and b. */\
+-      SymI_NeedsProto(__udivmoddi4) \
+-      /* SymI_NeedsProto(__udivmodti4) */ \
+-      /* These functions calculate both the quotient and remainder of the unsigned division of a and b. The return value is the quotient, and the remainder is placed in variable pointed to by c. */\
+-      /* SymI_NeedsProto(__umodsi3) */ \
+-      SymI_NeedsProto(__umoddi3) \
+-      /* SymI_NeedsProto(__umodti3) */ \
+-      /* These functions return the remainder of the unsigned division of a and b. */\
+-      /* 4.1.2 Comparison functions */\
+-      /* The following functions implement integral comparisons. These functions implement a low-level compare, upon which the higher level comparison operators (such as less than and greater than or equal to) can be constructed. The returned values lie in the range zero to two, to allow the high-level operators to be implemented by testing the returned result using either signed or unsigned comparison. */\
+-      SymI_NeedsProto(__cmpdi2) \
+-      /* SymI_NeedsProto(__cmpti2) */ \
+-      /* These functions perform a signed comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
+-      SymI_NeedsProto(__ucmpdi2) \
+-      /* SymI_NeedsProto(__ucmpti2) */ \
+-      /* These functions perform an unsigned comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
+-      /* 4.1.3 Trapping arithmetic functions */\
+-      /* The following functions implement trapping arithmetic. These functions call the libc function abort upon signed arithmetic overflow. */\
+-      SymI_NeedsProto(__absvsi2) \
+-      SymI_NeedsProto(__absvdi2) \
+-      /* These functions return the absolute value of a. */\
+-      /* SymI_NeedsProto(__addvsi3) */ \
+-      SymI_NeedsProto(__addvdi3) \
+-      /* These functions return the sum of a and b; that is a + b. */\
+-      /* SymI_NeedsProto(__mulvsi3) */ \
+-      SymI_NeedsProto(__mulvdi3) \
+-      /* The functions return the product of a and b; that is a * b. */\
+-      SymI_NeedsProto(__negvsi2) \
+-      SymI_NeedsProto(__negvdi2) \
+-      /* These functions return the negation of a; that is -a. */\
+-      /* SymI_NeedsProto(__subvsi3) */ \
+-      SymI_NeedsProto(__subvdi3) \
+-      /* These functions return the difference between b and a; that is a - b. */\
+-      /* 4.1.4 Bit operations */\
+-      SymI_NeedsProto(__clzsi2) \
+-      SymI_NeedsProto(__clzdi2) \
+-      /* SymI_NeedsProto(__clzti2) */ \
+-      /* These functions return the number of leading 0-bits in a, starting at the most significant bit position. If a is zero, the result is undefined. */\
+-      SymI_NeedsProto(__ctzsi2) \
+-      SymI_NeedsProto(__ctzdi2) \
+-      /* SymI_NeedsProto(__ctzti2) */ \
+-      /* These functions return the number of trailing 0-bits in a, starting at the least significant bit position. If a is zero, the result is undefined. */\
+-      SymI_NeedsProto(__ffsdi2) \
+-      /* SymI_NeedsProto(__ffsti2) */ \
+-      /* These functions return the index of the least significant 1-bit in a, or the value zero if a is zero. The least significant bit is index one. */\
+-      SymI_NeedsProto(__paritysi2) \
+-      SymI_NeedsProto(__paritydi2) \
+-      /* SymI_NeedsProto(__parityti2) */\
+-      /* These functions return the value zero if the number of bits set in a is even, and the value one otherwise. */\
+-      SymI_NeedsProto(__popcountsi2) \
+-      SymI_NeedsProto(__popcountdi2) \
+-      /* SymI_NeedsProto(__popcountti2) */ \
+-      /* These functions return the number of bits set in a. */\
+-      SymI_NeedsProto(__bswapsi2) \
+-      SymI_NeedsProto(__bswapdi2)
+-#define RTS_LIBGCC_SYMBOLS_aarch32                     \
+-      /* armv6l                                      */\
+-      /* TODO: should check for __ARM_EABI__         */\
+-      SymI_NeedsProto(__aeabi_d2f) \
+-      SymI_NeedsProto(__aeabi_d2iz) \
+-      SymI_NeedsProto(__aeabi_d2lz) \
+-      SymI_NeedsProto(__aeabi_d2uiz) \
+-      SymI_NeedsProto(__aeabi_d2ulz) \
+-      SymI_NeedsProto(__aeabi_dadd) \
+-      SymI_NeedsProto(__aeabi_dcmpeq) \
+-      SymI_NeedsProto(__aeabi_dcmpge) \
+-      SymI_NeedsProto(__aeabi_dcmpgt) \
+-      SymI_NeedsProto(__aeabi_dcmple) \
+-      SymI_NeedsProto(__aeabi_dcmplt) \
+-      SymI_NeedsProto(__aeabi_dcmpun) \
+-      SymI_NeedsProto(__aeabi_ddiv) \
+-      SymI_NeedsProto(__aeabi_dmul) \
+-      SymI_NeedsProto(__aeabi_dneg) \
+-      SymI_NeedsProto(__aeabi_dsub) \
+-      SymI_NeedsProto(__aeabi_f2d) \
+-      SymI_NeedsProto(__aeabi_f2iz) \
+-      SymI_NeedsProto(__aeabi_f2lz) \
+-      SymI_NeedsProto(__aeabi_f2uiz) \
+-      SymI_NeedsProto(__aeabi_f2ulz) \
+-      SymI_NeedsProto(__aeabi_fadd) \
+-      SymI_NeedsProto(__aeabi_fcmpeq) \
+-      SymI_NeedsProto(__aeabi_fcmpge) \
+-      SymI_NeedsProto(__aeabi_fcmpgt) \
+-      SymI_NeedsProto(__aeabi_fcmple) \
+-      SymI_NeedsProto(__aeabi_fcmplt) \
+-      SymI_NeedsProto(__aeabi_fcmpun) \
+-      SymI_NeedsProto(__aeabi_fdiv) \
+-      SymI_NeedsProto(__aeabi_fmul) \
+-      SymI_NeedsProto(__aeabi_fneg) \
+-      SymI_NeedsProto(__aeabi_fsub) \
+-      SymI_NeedsProto(__aeabi_i2d) \
+-      SymI_NeedsProto(__aeabi_i2f) \
+-      SymI_NeedsProto(__aeabi_idiv) \
+-      SymI_NeedsProto(__aeabi_idivmod) \
+-      SymI_NeedsProto(__aeabi_l2d) \
+-      SymI_NeedsProto(__aeabi_l2f) \
+-      SymI_NeedsProto(__aeabi_lasr) \
+-      SymI_NeedsProto(__aeabi_lcmp) \
+-      SymI_NeedsProto(__aeabi_ldivmod) \
+-      SymI_NeedsProto(__aeabi_llsl) \
+-      SymI_NeedsProto(__aeabi_llsr) \
+-      SymI_NeedsProto(__aeabi_lmul) \
+-      SymI_NeedsProto(__aeabi_ui2d) \
+-      SymI_NeedsProto(__aeabi_ui2f) \
+-      SymI_NeedsProto(__aeabi_uidiv) \
+-      SymI_NeedsProto(__aeabi_uidivmod) \
+-      SymI_NeedsProto(__aeabi_ul2d) \
+-      SymI_NeedsProto(__aeabi_ul2f) \
+-      SymI_NeedsProto(__aeabi_ulcmp) \
+-      SymI_NeedsProto(__aeabi_uldivmod)
+-#define RTS_LIBGCC_SYMBOLS_64                          \
++#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
++#define RTS_LIBGCC_SYMBOLS                             \
++      SymI_NeedsProto(__divdi3)                        \
++      SymI_NeedsProto(__udivdi3)                       \
++      SymI_NeedsProto(__moddi3)                        \
++      SymI_NeedsProto(__umoddi3)                       \
++      SymI_NeedsProto(__muldi3)                        \
++      SymI_NeedsProto(__ashldi3)                       \
++      SymI_NeedsProto(__ashrdi3)                       \
++      SymI_NeedsProto(__lshrdi3)                       \
++      SymI_NeedsProto(__fixunsdfdi)
++#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
++#define RTS_LIBGCC_SYMBOLS                             \
+       SymI_NeedsProto(__udivti3)                       \
+       SymI_NeedsProto(__umodti3)
+-
+-/* for aarch64                                        */
+-#define RTS_LIBGCC_SYMBOLS_aarch64                     \
+-      SymI_NeedsProto(__netf2)                         \
+-      SymI_NeedsProto(__addtf3)                        \
+-      SymI_NeedsProto(__subtf3)                        \
+-      SymI_NeedsProto(__multf3)                        \
+-      SymI_NeedsProto(__extenddftf2)                   \
+-      SymI_NeedsProto(__fixtfsi)                       \
+-      SymI_NeedsProto(__fixunstfsi)                    \
+-      SymI_NeedsProto(__floatsitf)                     \
+-      SymI_NeedsProto(__floatunsitf)
+-
+-#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && defined(arm_HOST_OS)
+-#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32 RTS_LIBGCC_SYMBOLS_aarch32
+-#elif defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
+-#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32
+-#elif defined(__GNUC__) && SIZEOF_VOID_P == 8 && defined(aarch64_HOST_OS)
+-#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64 RTS_LIBGCC_SYMBOLS_aarch64
+-#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
+-#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64
+ #else
+ #define RTS_LIBGCC_SYMBOLS
+ #endif
+ 
+-#if !defined(mingw32_HOST_OS) && !defined(DYNAMIC) && (defined(_FORTIFY_SOURCE) || defined(__SSP__))
+-#define RTS_SSP_SYMBOLS                                \
+-      SymI_NeedsProto(__stack_chk_guard)               \
+-      SymI_NeedsProto(__stack_chk_fail)
+-#else
+-#define RTS_SSP_SYMBOLS
+-#endif
+-#if !defined(DYNAMIC) && defined(linux_HOST_OS)
+-// we need these for static musl builds. However when
+-// linking shared objects (DLLs) this will fail, hence
+-// we do not include them when building with -DDYNAMIC
+-#define RTS_LINKER_SYMBOLS                             \
+-      SymI_NeedsProto(__fini_array_start)              \
+-      SymI_NeedsProto(__fini_array_end)
+-#else
+-#define RTS_LINKER_SYMBOLS
+-#endif
+-
+-#if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH)
+-      // Symbols that don't have a leading underscore
+-      // on Mac OS X. They have to receive special treatment,
+-      // see machoInitSymbolsWithoutUnderscore()
+-#define RTS_MACHO_NOUNDERLINE_SYMBOLS                   \
+-      SymI_NeedsProto(saveFP)                           \
+-      SymI_NeedsProto(restFP)
+-#endif
+-
+ /* entirely bogus claims about types of these symbols */
+-/* to prevent a bit of define expansion, SymI_NeedsProto is a variadic
+- * macro.  And we'll concat vvv with the __VA_ARGS__. This prevents
+- * vvv from getting macro expanded.
+- */
+-#define SymI_NeedsProto(vvv,...) extern void vvv ## __VA_ARGS__ (void);
++#define SymI_NeedsProto(vvv)  extern void vvv(void);
+ #define SymI_NeedsDataProto(vvv)  extern StgWord vvv[];
+ #if defined(COMPILING_WINDOWS_DLL)
+ #define SymE_HasProto(vvv)    SymE_HasProto(vvv);
+@@ -1209,8 +1026,6 @@ RTS_DARWIN_ONLY_SYMBOLS
+ RTS_OPENBSD_ONLY_SYMBOLS
+ RTS_LIBGCC_SYMBOLS
+ RTS_LIBFFI_SYMBOLS
+-RTS_SSP_SYMBOLS
+-RTS_LINKER_SYMBOLS
+ #undef SymI_NeedsProto
+ #undef SymI_NeedsDataProto
+ #undef SymI_HasProto
+@@ -1230,7 +1045,7 @@ RTS_LINKER_SYMBOLS
+ #define SymE_HasDataProto(vvv) \
+                     SymE_HasProto(vvv)
+ 
+-#define SymI_NeedsProto(vvv,...) SymI_HasProto(vvv ## __VA_ARGS__)
++#define SymI_NeedsProto(vvv) SymI_HasProto(vvv)
+ #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv)
+ #define SymE_NeedsProto(vvv) SymE_HasProto(vvv)
+ #define SymE_NeedsDataProto(vvv) SymE_HasDataProto(vvv)
+@@ -1251,8 +1066,6 @@ RTS_LINKER_SYMBOLS
+ #define SymI_HasProto_deprecated(vvv)   \
+    { #vvv, (void*)0xBAADF00D, true },
+ 
+-void *RTS_DYNAMIC = NULL;
+-
+ RtsSymbolVal rtsSyms[] = {
+       RTS_SYMBOLS
+       RTS_RET_SYMBOLS
+@@ -1264,14 +1077,11 @@ RtsSymbolVal rtsSyms[] = {
+       RTS_LIBGCC_SYMBOLS
+       RTS_LIBFFI_SYMBOLS
+       SymI_HasDataProto(nonmoving_write_barrier_enabled)
+-      RTS_SSP_SYMBOLS
+-      RTS_LINKER_SYMBOLS
+ #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)
+       // dyld stub code contains references to this,
+       // but it should never be called because we treat
+       // lazy pointers as nonlazy.
+       { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false },
+ #endif
+-      { "_DYNAMIC", (void*)(&RTS_DYNAMIC), false },
+       { 0, 0, false } /* sentinel */
+ };
+-- 
+2.25.4
+