[commit: ghc] master: Fix stage2 build on ARM. (be956c2)
Austin Seipp
mad.one at gmail.com
Mon Mar 18 23:41:40 CET 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
https://github.com/ghc/ghc/commit/be956c210bfe6f2a2917d4cb6951ba6a9e6cc318
>---------------------------------------------------------------
commit be956c210bfe6f2a2917d4cb6951ba6a9e6cc318
Author: Austin Seipp <mad.one at gmail.com>
Date: Mon Mar 18 22:19:59 2013 +0000
Fix stage2 build on ARM.
LLVM supports PIC on ARM from what I can see.
Signed-off-by: Austin Seipp <aseipp at pobox.com>
>---------------------------------------------------------------
compiler/main/DynFlags.hs | 1 +
compiler/utils/Platform.hs | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index dbec98a..a08370e 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3406,6 +3406,7 @@ makeDynFlagsConsistent dflags
in loop dflags' warn
| hscTarget dflags == HscLlvm &&
not ((arch == ArchX86_64) && (os == OSLinux || os == OSDarwin)) &&
+ not ((isARM arch) && (os == OSLinux)) &&
(not (gopt Opt_Static dflags) || gopt Opt_PIC dflags)
= if cGhcWithNativeCodeGen == "YES"
then let dflags' = dflags { hscTarget = HscAsm }
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 9e21326..213a63e 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -10,6 +10,7 @@ module Platform (
ArmABI(..),
target32Bit,
+ isARM,
osElfTarget,
platformUsesFrameworks,
)
@@ -54,6 +55,9 @@ data Arch
| ArchMipsel
deriving (Read, Show, Eq)
+isARM :: Arch -> Bool
+isARM (ArchARM {}) = True
+isARM _ = False
-- | Operating systems that the native code generator knows about.
-- Having OSUnknown should produce a sensible default, but no promises.
More information about the ghc-commits
mailing list