diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index d1449977..b279cb75 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -61,6 +61,10 @@ let self = # Debug , enableDebugRTS ? false +, enableDWARF ? false + +# LLVM +, useLLVM ? ghc.useLLVM }@drvArgs: let @@ -139,6 +143,10 @@ let ++ configureFlags ++ (ghc.extraConfigureFlags or []) ++ lib.optional enableDebugRTS "--ghc-option=-debug" + ++ lib.optional enableDWARF "--ghc-option=-g" + ++ lib.optionals useLLVM [ + "--ghc-option=-fPIC" "--gcc-option=-fPIC" + ] ); setupGhcOptions = lib.optional (package.ghcOptions != null) '' --ghc-options="${package.ghcOptions}"''; diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index 5fbfea41..808424b8 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -305,6 +305,7 @@ stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + inherit useLLVM; # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 68abbb06..feffe8ca 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -362,6 +362,7 @@ in { # with the current use of env and exact Deps. (builtins.mapAttrs (_: v: v // { + useLLVM = false; isHaskellNixBootCompiler = true; }) ({ @@ -571,6 +572,7 @@ in { v.overrideAttrs (drv: { postInstall = (drv.postInstall or "") + installDeps ""; }) // { + useLLVM = false; isHaskellNixBootCompiler = true; } )