on iko/ghcjs-patch-master help sign in
Add enableDWARF and useLLVM (#909)
23539aeMoritz Angermann
builder/comp-builder.nix+8
@@ -64,6 +64,10 @@ let self =
64
64
65# Debug
65# Debug
66, enableDebugRTS ? false
66, enableDebugRTS ? false
67+, enableDWARF ? false
68+
69+# LLVM
70+, useLLVM ? ghc.useLLVM
67}@drvArgs:
71}@drvArgs:
68
72
69let
73let
@@ -148,6 +152,10 @@ let
148 ++ configureFlags
152 ++ configureFlags
149 ++ (ghc.extraConfigureFlags or [])
153 ++ (ghc.extraConfigureFlags or [])
150 ++ lib.optional enableDebugRTS "--ghc-option=-debug"
154 ++ lib.optional enableDebugRTS "--ghc-option=-debug"
155+ ++ lib.optional enableDWARF "--ghc-option=-g"
156+ ++ lib.optionals useLLVM [
157+ "--ghc-option=-fPIC" "--gcc-option=-fPIC"
158+ ]
151 );
159 );
152
160
153 setupGhcOptions = lib.optional (package.ghcOptions != null) '' --ghc-options="${package.ghcOptions}"'';
161 setupGhcOptions = lib.optional (package.ghcOptions != null) '' --ghc-options="${package.ghcOptions}"'';
compiler/ghc/default.nix+1
@@ -305,6 +305,7 @@ stdenv.mkDerivation (rec {
305
305
306 inherit llvmPackages;
306 inherit llvmPackages;
307 inherit enableShared;
307 inherit enableShared;
308+ inherit useLLVM;
308
309
309 # Our Cabal compiler name
310 # Our Cabal compiler name
310 haskellCompilerName = "ghc-${version}";
311 haskellCompilerName = "ghc-${version}";
overlays/bootstrap.nix+2
@@ -400,6 +400,7 @@ in {
400 # with the current use of env and exact Deps.
400 # with the current use of env and exact Deps.
401 (builtins.mapAttrs
401 (builtins.mapAttrs
402 (_: v: v // {
402 (_: v: v // {
403+ useLLVM = false;
403 isHaskellNixBootCompiler = true;
404 isHaskellNixBootCompiler = true;
404 })
405 })
405 ({
406 ({
@@ -609,6 +610,7 @@ in {
609 v.overrideAttrs (drv: {
610 v.overrideAttrs (drv: {
610 postInstall = (drv.postInstall or "") + installDeps "";
611 postInstall = (drv.postInstall or "") + installDeps "";
611 }) // {
612 }) // {
613+ useLLVM = false;
612 isHaskellNixBootCompiler = true;
614 isHaskellNixBootCompiler = true;
613 }
615 }
614 )
616 )