Merge pull request #42312 from obsidiansystems/fix-android-prebuilt-ghc

Fix Android-prebuilt ghc build
This commit is contained in:
Peter Simons 2018-06-21 10:15:56 +02:00 committed by GitHub
commit 624a9ff647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -58,6 +58,8 @@ let
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99
'';
# Splicer will pull out correct variations

View File

@ -121,6 +121,8 @@ stdenv.mkDerivation rec {
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'';
# TODO(@Ericson2314): Always pass "--target" and always prefix.

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, m4, cxx ? true
, buildPackages
{ stdenv, fetchurl, m4, cxx ? !hostPlatform.useAndroidPrebuilt
, buildPackages, hostPlatform
, withStatic ? false }:
let inherit (stdenv.lib) optional optionalString; in