From 2ae46bc163512b3eecb60d70866d4ff19dac82bc Mon Sep 17 00:00:00 2001 From: Lukasz Czyzykowski Date: Mon, 22 May 2017 20:06:52 +0200 Subject: [PATCH 1/2] ghc: 8.0.2 without link warnings Fixes NixOS/nixpkgs#25139 by backporting patch applied in ghc trunk: https://phabricator.haskell.org/D2823 --- pkgs/development/compilers/ghc/8.0.2.nix | 4 +++- .../compilers/ghc/no-cpp-warnings.patch | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/ghc/no-cpp-warnings.patch diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix index 605458e7185..7463eb91e7a 100644 --- a/pkgs/development/compilers/ghc/8.0.2.nix +++ b/pkgs/development/compilers/ghc/8.0.2.nix @@ -19,7 +19,9 @@ stdenv.mkDerivation rec { sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi"; }; - patches = [] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch; + patches = [] + ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch + ++ stdenv.lib.optional stdenv.isDarwin ./no-cpp-warnings.patch; buildInputs = [ ghc perl hscolour sphinx ]; diff --git a/pkgs/development/compilers/ghc/no-cpp-warnings.patch b/pkgs/development/compilers/ghc/no-cpp-warnings.patch new file mode 100644 index 00000000000..90224df19f6 --- /dev/null +++ b/pkgs/development/compilers/ghc/no-cpp-warnings.patch @@ -0,0 +1,23 @@ +--- 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) + From d45aff53276d263ff1df73c001873f0ed64bffd3 Mon Sep 17 00:00:00 2001 From: Lukasz Czyzykowski Date: Sun, 11 Jun 2017 21:52:41 +0200 Subject: [PATCH 2/2] Adds ghc version to the patch file --- pkgs/development/compilers/ghc/8.0.2.nix | 2 +- .../{no-cpp-warnings.patch => ghc-8.0.2-no-cpp-warnings.patch} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/development/compilers/ghc/{no-cpp-warnings.patch => ghc-8.0.2-no-cpp-warnings.patch} (100%) diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix index 7463eb91e7a..cc0b1d4eadd 100644 --- a/pkgs/development/compilers/ghc/8.0.2.nix +++ b/pkgs/development/compilers/ghc/8.0.2.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { patches = [] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch - ++ stdenv.lib.optional stdenv.isDarwin ./no-cpp-warnings.patch; + ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch; buildInputs = [ ghc perl hscolour sphinx ]; diff --git a/pkgs/development/compilers/ghc/no-cpp-warnings.patch b/pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch similarity index 100% rename from pkgs/development/compilers/ghc/no-cpp-warnings.patch rename to pkgs/development/compilers/ghc/ghc-8.0.2-no-cpp-warnings.patch