Merge pull request #69552 from domenkozar/ghc-dwarf
ghc: compile with DWARF support by default
This commit is contained in:
commit
1b13a8f2e7
|
@ -2,11 +2,14 @@
|
||||||
|
|
||||||
# build-tools
|
# build-tools
|
||||||
, bootPkgs
|
, bootPkgs
|
||||||
, autoconf, automake, coreutils, fetchgit, fetchpatch, perl, python3, m4, sphinx
|
, autoconf, autoreconfHook, automake, coreutils, fetchgit, fetchpatch, perl, python3, m4, sphinx
|
||||||
, bash
|
, bash
|
||||||
|
|
||||||
, libiconv ? null, ncurses
|
, libiconv ? null, ncurses
|
||||||
|
|
||||||
|
, enableDwarf ? !stdenv.targetPlatform.isDarwin &&
|
||||||
|
!stdenv.targetPlatform.isWindows, elfutils # for DWARF support
|
||||||
|
|
||||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||||
|
@ -27,7 +30,7 @@
|
||||||
, # Whetherto build terminfo.
|
, # Whetherto build terminfo.
|
||||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||||
|
|
||||||
, version ? "8.9.20190924"
|
, version ? "8.10.20191119"
|
||||||
, # What flavour to build. An empty string indicates no
|
, # What flavour to build. An empty string indicates no
|
||||||
# specific flavour and falls back to ghc default values.
|
# specific flavour and falls back to ghc default values.
|
||||||
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
||||||
|
@ -73,7 +76,8 @@ let
|
||||||
# Splicer will pull out correct variations
|
# Splicer will pull out correct variations
|
||||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
++ 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 = [
|
toolsForTarget = [
|
||||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||||
|
@ -89,8 +93,8 @@ stdenv.mkDerivation (rec {
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://gitlab.haskell.org/ghc/ghc.git/";
|
url = "https://gitlab.haskell.org/ghc/ghc.git/";
|
||||||
rev = "795986aaf33e2ffc233836b86a92a77366c91db2";
|
rev = "0418c38d55c7a47967187dce2db5ea2ab1021b1e";
|
||||||
sha256 = "0a111x6c53r07q5qdg6c8mnydqp0wh4mpxmw7ga4x5wlap8i0bji";
|
sha256 = "1d8g30ii0w4xh6fh61bxbalsqqyanny99nn3p727fx7favnhgvxi";
|
||||||
};
|
};
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -98,13 +102,6 @@ stdenv.mkDerivation (rec {
|
||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
(fetchpatch { # https://github.com/haskell/haddock/issues/900
|
|
||||||
url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/983.diff";
|
|
||||||
name = "loadpluginsinmodules.diff";
|
|
||||||
sha256 = "0bvvv0zsfq2581zsir97zfkggc1kkircbbajc2fz3b169ycpbha1";
|
|
||||||
extraPrefix = "utils/haddock/";
|
|
||||||
stripLen = 1;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = "patchShebangs .";
|
postPatch = "patchShebangs .";
|
||||||
|
@ -176,13 +173,17 @@ stdenv.mkDerivation (rec {
|
||||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||||
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
||||||
"--disable-large-address-space"
|
"--disable-large-address-space"
|
||||||
|
] ++ stdenv.lib.optional enableDwarf [
|
||||||
|
"--enable-dwarf-unwind"
|
||||||
|
"--with-libdw-includes=${stdenv.lib.getDev elfutils}/include"
|
||||||
|
"--with-libdw-libraries=${stdenv.lib.getLib elfutils}/lib"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
perl autoconf automake m4 python3 sphinx
|
perl autoconf autoreconfHook automake m4 python3 sphinx
|
||||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue