Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GHC work on armv7l-linux #33405

Merged
merged 4 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/development/compilers/ghc/7.10.3-binary.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv
, fetchurl, perl
, ncurses5, gmp, libiconv
, gcc
, gcc, llvm_35
}:

# Prebuilt only does native
Expand Down Expand Up @@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
or (throw "cannot bootstrap GHC on this platform"));

nativeBuildInputs = [ perl ];
buildInputs = stdenv.lib.optionals stdenv.isArm [ llvm_35 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdenv.targetPlatform.isArm


# Cannot patchelf beforehand due to relative RPATHs that anticipate
# the final install location/
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/ghc/7.10.3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, buildPlatform, hostPlatform, targetPlatform

# build-tools
, bootPkgs, hscolour
, bootPkgs, hscolour, llvm_35
, coreutils, fetchurl, fetchpatch, perl
, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt

Expand Down Expand Up @@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
./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 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

targetPlatform.isArm


enableParallelBuilding = true;

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/ghc/8.0.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, buildPlatform, hostPlatform, targetPlatform

# build-tools
, bootPkgs, hscolour
, bootPkgs, hscolour, llvm_37
, coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx

, libiconv ? null, ncurses
Expand Down Expand Up @@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.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;

Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/ghc/8.2.1-binary.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv
, fetchurl, perl, gcc
, fetchurl, perl, gcc, llvm_39
, ncurses5, gmp, libiconv
}:

Expand Down Expand Up @@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
or (throw "cannot bootstrap GHC on this platform"));

nativeBuildInputs = [ perl ];
buildInputs = stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ llvm_39 ];
Copy link
Member

@Ericson2314 Ericson2314 Jan 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(with stdenv.targetPlatform; isArm || isAarch64)


# Cannot patchelf beforehand due to relative RPATHs that anticipate
# the final install location/
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/ghc/8.2.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, selfPkgs, cross ? null

# build-tools
, bootPkgs, alex, happy, hscolour
, bootPkgs, alex, happy, hscolour, llvm_39
, autoconf, automake, coreutils, fetchurl, perl, python3, sphinx

, libiconv ? null, ncurses
Expand Down Expand Up @@ -46,7 +46,7 @@ stdenv.mkDerivation (rec {
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 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(targetPlatform.isArm || targetPlatform.isAarch64)


enableParallelBuilding = true;

Expand All @@ -58,6 +58,8 @@ stdenv.mkDerivation (rec {
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
] ++ stdenv.lib.optional stdenv.isDarwin [
"--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
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1023,4 +1023,6 @@ self: super: {
# https://github.com/Twinside/Juicy.Pixels/issues/149
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
}
2 changes: 1 addition & 1 deletion pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ let
(optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
(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")
(enableFeature (enableDeadCodeElimination && (versionAtLeast "8.0.1" ghc.version)) "split-objs")
(enableFeature (enableDeadCodeElimination && !stdenv.isArm && !stdenv.isAarch64 && (versionAtLeast "8.0.1" ghc.version)) "split-objs")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(hostPlatform.isArm || hostPlatform.isAarch64)

(enableFeature enableLibraryProfiling "library-profiling")
(enableFeature enableExecutableProfiling (if versionOlder ghc.version "8" then "executable-profiling" else "profiling"))
(enableFeature enableSharedLibraries "shared")
Expand Down