on iko/ghcjs-patch-master help sign in
Add enableDWARF and useLLVM (#909)

(cherry picked from commit dc44dbcfe57bc66946192fa3fffdf426431798ea)

commit23539aef9ea3591dc0d218c5f60b2a4f7d229a20 authorMoritz Angermann <moritz.angermann@gmail.com> dateThu 5 Nov 2020, 13:43 (6 years ago) parent778f1ab
3 files changed+11
builder/comp-builder.nix+8 compiler/ghc/default.nix+1 overlays/bootstrap.nix+2
builder/comp-builder.nix+8
@@ -64,6 +64,10 @@ let self =
6464
6565# Debug
6666, enableDebugRTS ? false
67+, enableDWARF ? false
68+
69+# LLVM
70+, useLLVM ? ghc.useLLVM
6771}@drvArgs:
6872
6973let
@@ -148,6 +152,10 @@ let
148152 ++ configureFlags
149153 ++ (ghc.extraConfigureFlags or [])
150154 ++ 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+ ]
151159 );
152160
153161 setupGhcOptions = lib.optional (package.ghcOptions != null) '' --ghc-options="${package.ghcOptions}"'';
compiler/ghc/default.nix+1
@@ -305,6 +305,7 @@ stdenv.mkDerivation (rec {
305305
306306 inherit llvmPackages;
307307 inherit enableShared;
308+ inherit useLLVM;
308309
309310 # Our Cabal compiler name
310311 haskellCompilerName = "ghc-${version}";
overlays/bootstrap.nix+2
@@ -400,6 +400,7 @@ in {
400400 # with the current use of env and exact Deps.
401401 (builtins.mapAttrs
402402 (_: v: v // {
403+ useLLVM = false;
403404 isHaskellNixBootCompiler = true;
404405 })
405406 ({
@@ -609,6 +610,7 @@ in {
609610 v.overrideAttrs (drv: {
610611 postInstall = (drv.postInstall or "") + installDeps "";
611612 }) // {
613+ useLLVM = false;
612614 isHaskellNixBootCompiler = true;
613615 }
614616 )