Merge pull request #37598 from dtzWill/feature/ghc-cross-musl

ghc-{8.2.2,8.4.1}: fixups mostly for 2-stage cross, musl
This commit is contained in:
John Ericson 2018-06-18 17:01:31 -04:00 committed by GitHub
commit 07ff2c27f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 2 deletions

View File

@ -51,7 +51,8 @@ let
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = YES
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
@ -93,6 +94,27 @@ stdenv.mkDerivation rec {
sha256 = "03253ci40np1v6k0wmi4aypj3nmj3rdyvb1k6rwqipb30nfc719f";
})
(import ./abi-depends-determinism.nix { inherit fetchpatch runCommand; })
] ++ stdenv.lib.optionals (hostPlatform != targetPlatform && targetPlatform.system == hostPlatform.system) [
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch";
sha256 = "1hxj80bjx0x3w0f35cj3k2wipppr1ald03jwfy5q0xlxygdha17w";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch";
sha256 = "12xsln3zyfpvml8bwdpbc003h6zl1qh2qcq1rhdrw02n45dz8lvc";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch";
sha256 = "03dcqf5af3vjhrky3f2z26j4d9h8qd9nkv76xp0l97h4cqk7vfqb";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch";
sha256 = "0pi2m85wjxaaablq6n4q5vyn9qxvry5d7nmja4b28i68yb4ly9g1";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-hp2ps-cross.patch";
sha256 = "1fszfavf1cvrf02x500mi7jykcpvpl2i7i4qzr2qz9sbmyq063f0";
})
] ++ stdenv.lib.optional deterministicProfiling
(fetchpatch { # Backport of https://phabricator.haskell.org/D4388 for more determinism
url = "https://github.com/shlevy/ghc/commit/fec1b8d3555c447c0d8da0e96b659be67c8bb4bc.patch";
@ -134,6 +156,7 @@ stdenv.mkDerivation rec {
# `--with` flags for libraries needed for RTS linker
configureFlags = [
"--datadir=$doc/share/doc/ghc"
] ++ stdenv.lib.optional (targetPlatform == hostPlatform) [
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"

View File

@ -49,7 +49,8 @@ let
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = YES
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
@ -129,6 +130,7 @@ stdenv.mkDerivation rec {
# `--with` flags for libraries needed for RTS linker
configureFlags = [
"--datadir=$doc/share/doc/ghc"
] ++ stdenv.lib.optional (targetPlatform == hostPlatform) [
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"