[commit: ghc] master: Add support for iOS simulator (issue #8152). (b7130bf)

git at git.haskell.org git at git.haskell.org
Sat Aug 24 12:03:49 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b7130bfd1a042753a177c7212aee8223846f7992/ghc

>---------------------------------------------------------------

commit b7130bfd1a042753a177c7212aee8223846f7992
Author: Austin Seipp <aseipp at pobox.com>
Date:   Fri Aug 23 21:49:50 2013 -0500

    Add support for iOS simulator (issue #8152).
    
    The iOS simulator is essentially an iOS target but for an x86 machine
    instead. It doesn't support the native code generator either, though.
    
    Authored-by: Stephen Blackheath <... at blacksapphire.com>
    Signed-off-by: Austin Seipp <aseipp at pobox.com>


>---------------------------------------------------------------

b7130bfd1a042753a177c7212aee8223846f7992
 aclocal.m4                          |    4 ++--
 compiler/llvmGen/LlvmCodeGen/Ppr.hs |    3 +++
 mk/config.mk.in                     |    4 ++--
 rts/StgCRun.c                       |    2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index d604cc0..3c615b6 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -25,7 +25,7 @@ AC_DEFUN([GHC_SELECT_FILE_EXTENSIONS],
     x86_64-apple-darwin)
         $3='.dylib'
         ;;
-    arm-apple-darwin10)
+    arm-apple-darwin10|i386-apple-darwin11)
         $2='.a'
         $3='.dylib'
         ;;
@@ -1918,7 +1918,7 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
 # converts os from gnu to ghc naming, and assigns the result to $target_var
 AC_DEFUN([GHC_CONVERT_OS],[
 case "$1-$2" in
-  darwin10-arm)
+  darwin10-arm|darwin11-i386)
     $3="ios"
     ;;
   *)
diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
index 1c63d3f..a459028 100644
--- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
@@ -61,6 +61,9 @@ moduleLayout = sdocWithPlatform $ \platform ->
     Platform { platformArch = ArchARM {}, platformOS = OSiOS } ->
         text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
         $+$ text "target triple = \"arm-apple-darwin10\""
+    Platform { platformArch = ArchX86, platformOS = OSiOS } ->
+        text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32\""
+        $+$ text "target triple = \"i386-apple-darwin11\""
     _ ->
         -- FIX: Other targets
         empty
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 1129cc2..5a039ba 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -161,9 +161,9 @@ GhcUnregisterised=@Unregisterised@
 #
 # Target platforms supported:
 #   i386, powerpc
-#   AIX is not supported 
+#   IOS and AIX are not supported 
 ArchSupportsNCG=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc sparc)))
-OsSupportsNCG=$(strip $(patsubst $(TargetOS_CPP), YES, $(patsubst aix,,$(TargetOS_CPP))))
+OsSupportsNCG=$(strip $(patsubst $(TargetOS_CPP), YES, $(patsubst ios,,$(patsubst aix,,$(TargetOS_CPP)))))
 
 GhcWithNativeCodeGen := $(strip\
     $(if $(filter YESYESNO,\
diff --git a/rts/StgCRun.c b/rts/StgCRun.c
index a45c52f..940e16d 100644
--- a/rts/StgCRun.c
+++ b/rts/StgCRun.c
@@ -116,7 +116,7 @@ StgWord8 *win32AllocStack(void)
 
 #ifdef i386_HOST_ARCH
 
-#ifdef darwin_HOST_OS
+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
 #define STG_GLOBAL ".globl "
 #define STG_HIDDEN ".private_extern "
 #else





More information about the ghc-commits mailing list