[commit: ghc] master: Adds x86_64-apple-darwin14 target. (f560a03)
git at git.haskell.org
git at git.haskell.org
Tue Jul 5 20:09:04 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f560a03ccdb246083fe64da3507c5be4c40960fe/ghc
>---------------------------------------------------------------
commit f560a03ccdb246083fe64da3507c5be4c40960fe
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date: Tue Jul 5 20:32:22 2016 +0200
Adds x86_64-apple-darwin14 target.
x86_64-apple-darwin14, is the target for the 64bit simulator.
Ideally, we'd have (i386|armv7|arm64|x64_86)-apple-ios, yet,
many #ifdefs depend on `darwin`, notably libffi. Hence, this only adds
x86_64-apple-darwin14 as a target. This also updates the comment to
add the `-S` flag, and dump the output to stdout; and adjusts the
`datalayout` and `triple` values, as obtained through the method
mentioned in the comment.
Reviewers: hvr, erikd, austin, bgamari, simonmar
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2378
>---------------------------------------------------------------
f560a03ccdb246083fe64da3507c5be4c40960fe
aclocal.m4 | 4 ++--
compiler/llvmGen/LlvmCodeGen/Ppr.hs | 17 ++++++++++-------
rts/StgCRun.c | 4 ++--
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index cbf51df..ce8944c 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|i386-apple-darwin11|aarch64-apple-darwin14)
+ arm-apple-darwin10|i386-apple-darwin11|aarch64-apple-darwin14|x86_64-apple-darwin14)
$2='.a'
$3='.dylib'
;;
@@ -1936,7 +1936,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|darwin11-i386|darwin14-aarch64)
+ darwin10-arm|darwin11-i386|darwin14-aarch64|darwin14-x86_64)
$3="ios"
;;
*)
diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
index 1de630e..37d1391 100644
--- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
@@ -60,14 +60,17 @@ moduleLayout = sdocWithPlatform $ \platform ->
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-unknown-nto-qnx8.0.0eabi\""
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\""
+ text "target datalayout = \"e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32\""
+ $+$ text "target triple = \"thumbv7-apple-ios7.0.0\""
Platform { platformArch = ArchARM64, platformOS = OSiOS } ->
- text "target datalayout = \"e-p:64:64:64-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:128:128-a0:0:64-n32:64-S128\""
+ text "target datalayout = \"e-m:o-i64:64-i128:128-n32:64-S128\""
$+$ text "target triple = \"arm64-apple-ios7.0.0\""
+ Platform { platformArch = ArchX86, platformOS = OSiOS } ->
+ text "target datalayout = \"e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128\""
+ $+$ text "target triple = \"i386-apple-ios7.0.0\""
+ Platform { platformArch = ArchX86_64, platformOS = OSiOS } ->
+ text "target datalayout = \"e-m:o-i64:64-f80:128-n8:16:32:64-S128\""
+ $+$ text "target triple = \"x86_64-apple-ios7.0.0\""
Platform { platformArch = ArchARM64, platformOS = OSLinux } ->
text "target datalayout = \"e-m:e-i64:64-i128:128-n32:64-S128\""
$+$ text "target triple = \"aarch64-unknown-linux-gnu\""
@@ -78,7 +81,7 @@ moduleLayout = sdocWithPlatform $ \platform ->
-- If you see the above panic, GHC is missing the required target datalayout
-- and triple information. You can obtain this info by compiling a simple
-- 'hello world' C program with the clang C compiler eg:
- -- clang hello.c -emit-llvm -o hello.ll
+ -- clang -S hello.c -emit-llvm -o -
-- and the first two lines of hello.ll should provide the 'target datalayout'
-- and 'target triple' lines required.
diff --git a/rts/StgCRun.c b/rts/StgCRun.c
index cf0c05c..c110f51 100644
--- a/rts/StgCRun.c
+++ b/rts/StgCRun.c
@@ -245,7 +245,7 @@ StgRunIsImplementedInAssembler(void)
#define STG_GLOBAL ".globl "
-#ifdef darwin_HOST_OS
+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
#define STG_HIDDEN ".private_extern "
#else
#define STG_HIDDEN ".hidden "
@@ -417,7 +417,7 @@ StgRun(StgFunPtr f, StgRegTable *basereg) {
#define STG_GLOBAL ".globl "
-#ifdef darwin_HOST_OS
+#if defined(darwin_HOST_OS)
#define STG_HIDDEN ".private_extern "
#else
#define STG_HIDDEN ".hidden "
More information about the ghc-commits
mailing list