Merge pull request #33405 from dhess/ghc-armv7l
Make GHC work on armv7l-linux
This commit is contained in:
commit
48a6d1a2ab
@ -1,7 +1,7 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, fetchurl, perl
|
, fetchurl, perl
|
||||||
, ncurses5, gmp, libiconv
|
, ncurses5, gmp, libiconv
|
||||||
, gcc
|
, gcc, llvm_35
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# Prebuilt only does native
|
# Prebuilt only does native
|
||||||
@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
|
|||||||
or (throw "cannot bootstrap GHC on this platform"));
|
or (throw "cannot bootstrap GHC on this platform"));
|
||||||
|
|
||||||
nativeBuildInputs = [ perl ];
|
nativeBuildInputs = [ perl ];
|
||||||
|
buildInputs = stdenv.lib.optionals stdenv.isArm [ llvm_35 ];
|
||||||
|
|
||||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||||
# the final install location/
|
# the final install location/
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
, buildPlatform, hostPlatform, targetPlatform
|
, buildPlatform, hostPlatform, targetPlatform
|
||||||
|
|
||||||
# build-tools
|
# build-tools
|
||||||
, bootPkgs, hscolour
|
, bootPkgs, hscolour, llvm_35
|
||||||
, coreutils, fetchurl, fetchpatch, perl
|
, coreutils, fetchurl, fetchpatch, perl
|
||||||
, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
|
, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
|
|||||||
./relocation.patch
|
./relocation.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
|
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ] ++ stdenv.lib.optionals stdenv.isArm [ llvm_35 ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
, buildPlatform, hostPlatform, targetPlatform
|
, buildPlatform, hostPlatform, targetPlatform
|
||||||
|
|
||||||
# build-tools
|
# build-tools
|
||||||
, bootPkgs, hscolour
|
, bootPkgs, hscolour, llvm_37
|
||||||
, coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx
|
, coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx
|
||||||
|
|
||||||
, libiconv ? null, ncurses
|
, libiconv ? null, ncurses
|
||||||
@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
|
|||||||
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
|
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
|
||||||
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
|
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
|
||||||
|
|
||||||
buildInputs = [ ghc perl hscolour sphinx ];
|
buildInputs = [ ghc perl hscolour sphinx ] ++ stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ llvm_37 ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, fetchurl, perl, gcc
|
, fetchurl, perl, gcc, llvm_39
|
||||||
, ncurses5, gmp, libiconv
|
, ncurses5, gmp, libiconv
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
|
|||||||
or (throw "cannot bootstrap GHC on this platform"));
|
or (throw "cannot bootstrap GHC on this platform"));
|
||||||
|
|
||||||
nativeBuildInputs = [ perl ];
|
nativeBuildInputs = [ perl ];
|
||||||
|
buildInputs = stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ llvm_39 ];
|
||||||
|
|
||||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||||
# the final install location/
|
# the final install location/
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
, selfPkgs, cross ? null
|
, selfPkgs, cross ? null
|
||||||
|
|
||||||
# build-tools
|
# build-tools
|
||||||
, bootPkgs, alex, happy, hscolour
|
, bootPkgs, alex, happy, hscolour, llvm_39
|
||||||
, autoconf, automake, coreutils, fetchurl, perl, python3, sphinx
|
, autoconf, automake, coreutils, fetchurl, perl, python3, sphinx
|
||||||
|
|
||||||
, libiconv ? null, ncurses
|
, libiconv ? null, ncurses
|
||||||
@ -46,7 +46,7 @@ stdenv.mkDerivation (rec {
|
|||||||
sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk
|
sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
|
buildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ] ++ stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ llvm_39 ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
@ -58,6 +58,8 @@ stdenv.mkDerivation (rec {
|
|||||||
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
|
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
|
||||||
] ++ stdenv.lib.optional stdenv.isDarwin [
|
] ++ stdenv.lib.optional stdenv.isDarwin [
|
||||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||||
|
] ++ stdenv.lib.optional stdenv.isArm [
|
||||||
|
"LD=${stdenv.cc}/bin/ld.gold"
|
||||||
];
|
];
|
||||||
|
|
||||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||||
|
@ -1029,4 +1029,6 @@ self: super: {
|
|||||||
# https://github.com/Twinside/Juicy.Pixels/issues/149
|
# https://github.com/Twinside/Juicy.Pixels/issues/149
|
||||||
JuicyPixels = dontHaddock super.JuicyPixels;
|
JuicyPixels = dontHaddock super.JuicyPixels;
|
||||||
|
|
||||||
|
# armv7l fixes.
|
||||||
|
happy = if pkgs.stdenv.isArm then dontCheck super.happy else super.happy; # Similar to https://ghc.haskell.org/trac/ghc/ticket/13062
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ let
|
|||||||
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
|
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
|
||||||
(optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
|
(optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
|
||||||
(optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
|
(optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
|
||||||
(enableFeature (enableDeadCodeElimination && (versionAtLeast "8.0.1" ghc.version)) "split-objs")
|
(enableFeature (enableDeadCodeElimination && !stdenv.isArm && !stdenv.isAarch64 && (versionAtLeast "8.0.1" ghc.version)) "split-objs")
|
||||||
(enableFeature enableLibraryProfiling "library-profiling")
|
(enableFeature enableLibraryProfiling "library-profiling")
|
||||||
(enableFeature enableExecutableProfiling (if versionOlder ghc.version "8" then "executable-profiling" else "profiling"))
|
(enableFeature enableExecutableProfiling (if versionOlder ghc.version "8" then "executable-profiling" else "profiling"))
|
||||||
(enableFeature enableSharedLibraries "shared")
|
(enableFeature enableSharedLibraries "shared")
|
||||||
|
Loading…
Reference in New Issue
Block a user