diff options
author | Domen Kožar <domen@dev.si> | 2019-09-09 17:57:13 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2019-09-11 10:52:04 +0200 |
commit | f4316473d94e0e5eff2736bd24dc802e09752771 (patch) | |
tree | 71e511845e387e0c63b369ec13c1f8812fa77672 /pkgs/development | |
parent | f2bf25e53ae6f5ab16b0e2d82a31eddd4818e312 (diff) |
ghc: compile with DWARF support by default
This allows our GHCs to build programs with DWARF debug information when -g is passed, see https://ghc.haskell.org/trac/ghc/wiki/DWARF. Compiling with debug symbols is off by default until GHC ticket #15960 (Using -g causes differences in generated core) is fixed.
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/ghc/8.2.2.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.4.4.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.6.4.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.6.5.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.8.1.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/head.nix | 7 |
6 files changed, 36 insertions, 6 deletions
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index a034e4ec8dd8d..7c13db74c4c8c 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -8,6 +8,8 @@ , libiconv ? null, ncurses +, enableDwarf ? !stdenv.isDarwin, elfutils # for DWARF support + , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a @@ -69,7 +71,8 @@ let # Splicer will pull out correct variations libDeps = platform: [ ncurses ] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc") libiconv + ++ stdenv.lib.optional enableDwarf elfutils; toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc @@ -203,6 +206,8 @@ stdenv.mkDerivation (rec { ] ++ 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/ "--disable-large-address-space" + ] ++ stdenv.lib.optional enableDwarf [ + "--enable-dwarf-unwind" ]; # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. diff --git a/pkgs/development/compilers/ghc/8.4.4.nix b/pkgs/development/compilers/ghc/8.4.4.nix index 52fb926cdc684..30353771ea633 100644 --- a/pkgs/development/compilers/ghc/8.4.4.nix +++ b/pkgs/development/compilers/ghc/8.4.4.nix @@ -7,6 +7,8 @@ , libiconv ? null, ncurses +, enableDwarf ? !stdenv.isDarwin, elfutils # for DWARF support + , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a @@ -71,7 +73,8 @@ let # Splicer will pull out correct variations libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv + ++ stdenv.lib.optional enableDwarf elfutils; toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc @@ -180,6 +183,8 @@ stdenv.mkDerivation (rec { ] ++ 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/ "--disable-large-address-space" + ] ++ stdenv.lib.optional enableDwarf [ + "--enable-dwarf-unwind" ]; # Make sure we never relax`$PATH` and hooks support for compatability. diff --git a/pkgs/development/compilers/ghc/8.6.4.nix b/pkgs/development/compilers/ghc/8.6.4.nix index 18b2407a90baf..7b6769df682a7 100644 --- a/pkgs/development/compilers/ghc/8.6.4.nix +++ b/pkgs/development/compilers/ghc/8.6.4.nix @@ -7,6 +7,8 @@ , libiconv ? null, ncurses +, enableDwarf ? !stdenv.isDarwin, elfutils # for DWARF support + , # GHC can be built with system libffi or a bundled one. libffi ? null @@ -76,7 +78,8 @@ let libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv + ++ stdenv.lib.optional enableDwarf elfutils; toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc @@ -179,6 +182,8 @@ stdenv.mkDerivation (rec { "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ "--disable-large-address-space" + ] ++ stdenv.lib.optional enableDwarf [ + "--enable-dwarf-unwind" ]; # Make sure we never relax`$PATH` and hooks support for compatability. diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index cdbcb8e1aedc5..acc97f93c6309 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -7,6 +7,8 @@ , libiconv ? null, ncurses +, enableDwarf ? !stdenv.isDarwin, elfutils # for DWARF support + , # GHC can be built with system libffi or a bundled one. libffi ? null @@ -76,7 +78,8 @@ let libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv + ++ stdenv.lib.optional enableDwarf elfutils; toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc @@ -179,6 +182,8 @@ stdenv.mkDerivation (rec { "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ "--disable-large-address-space" + ] ++ stdenv.lib.optional enableDwarf [ + "--enable-dwarf-unwind" ]; # Make sure we never relax`$PATH` and hooks support for compatability. diff --git a/pkgs/development/compilers/ghc/8.8.1.nix b/pkgs/development/compilers/ghc/8.8.1.nix index 95bbab3cb3e11..c80ccf72817f0 100644 --- a/pkgs/development/compilers/ghc/8.8.1.nix +++ b/pkgs/development/compilers/ghc/8.8.1.nix @@ -7,6 +7,8 @@ , libiconv ? null, ncurses +, enableDwarf ? !stdenv.isDarwin, elfutils # for DWARF support + , # GHC can be built with system libffi or a bundled one. libffi ? null @@ -76,7 +78,8 @@ let libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] ++ [libffi] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv + ++ stdenv.lib.optional enableDwarf elfutils; toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc @@ -164,6 +167,8 @@ stdenv.mkDerivation (rec { "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ "--disable-large-address-space" + ] ++ stdenv.lib.optional enableDwarf [ + "--enable-dwarf-unwind" ]; # Make sure we never relax`$PATH` and hooks support for compatability. diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index b78f5bc2204cd..240b55deb6824 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -7,6 +7,8 @@ , libiconv ? null, ncurses +, enableDwarf ? !stdenv.isDarwin, elfutils # for DWARF support + , 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 @@ -73,7 +75,8 @@ let # Splicer will pull out correct variations libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] ++ stdenv.lib.optional (!enableIntegerSimple) gmp - ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; + ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv + ++ stdenv.lib.optional enableDwarf elfutils; toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc @@ -176,6 +179,8 @@ stdenv.mkDerivation (rec { "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ "--disable-large-address-space" + ] ++ stdenv.lib.optional enableDwarf [ + "--enable-dwarf-unwind" ]; # Make sure we never relax`$PATH` and hooks support for compatability. |