projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LLVM: Add support for 64bit OSX. (partial #4210)
[ghc-hetmet.git]
/
compiler
/
llvmGen
/
LlvmMangler.hs
diff --git
a/compiler/llvmGen/LlvmMangler.hs
b/compiler/llvmGen/LlvmMangler.hs
index
ac187e0
..
890f710
100644
(file)
--- a/
compiler/llvmGen/LlvmMangler.hs
+++ b/
compiler/llvmGen/LlvmMangler.hs
@@
-12,6
+12,8
@@
module LlvmMangler ( llvmFixupAsm ) where
module LlvmMangler ( llvmFixupAsm ) where
+#include "HsVersions.h"
+
import Control.Exception
import qualified Data.ByteString.Char8 as B
import Data.Char
import Control.Exception
import qualified Data.ByteString.Char8 as B
import Data.Char
@@
-23,14
+25,20
@@
infoSec, newInfoSec, newLine, spInst, jmpInst :: B.ByteString
infoSec = B.pack "\t.section\t__STRIP,__me"
newInfoSec = B.pack "\n\t.text"
newLine = B.pack "\n"
infoSec = B.pack "\t.section\t__STRIP,__me"
newInfoSec = B.pack "\n\t.text"
newLine = B.pack "\n"
-spInst = B.pack ", %esp\n"
jmpInst = B.pack "\n\tjmp"
jmpInst = B.pack "\n\tjmp"
-infoLen, spFix, labelStart :: Int
-infoLen = B.length infoSec
-spFix = 4
+infoLen, labelStart, spFix :: Int
+infoLen = B.length infoSec
labelStart = B.length jmpInst
labelStart = B.length jmpInst
+#if x86_64_TARGET_ARCH
+spInst = B.pack ", %rsp\n"
+spFix = 8
+#else
+spInst = B.pack ", %esp\n"
+spFix = 4
+#endif
+
-- Search Predicates
eolPred, dollarPred, commaPred :: Char -> Bool
eolPred = ((==) '\n')
-- Search Predicates
eolPred, dollarPred, commaPred :: Char -> Bool
eolPred = ((==) '\n')