Commit 75851bf9 authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

fix ghci build on ArchUnknown targets



Observed failure on ia64 as:

    "inplace/bin/hsc2hs" \
         ... \
         --cflag=-Dia64_HOST_ARCH=1 --cflag=-Dlinux_HOST_OS=1 \
         ... \
         libraries/ghci/./GHCi/InfoTable.hsc \
         -o libraries/ghci/dist-install/build/GHCi/InfoTable.hs

    InfoTable.hsc:84:2: error: #error Unknown architecture
Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
parent 25e4556d
...@@ -56,8 +56,16 @@ type ItblCodes = Either [Word8] [Word32] ...@@ -56,8 +56,16 @@ type ItblCodes = Either [Word8] [Word32]
funPtrToInt :: FunPtr a -> Int funPtrToInt :: FunPtr a -> Int
funPtrToInt (FunPtr a) = I## (addr2Int## a) funPtrToInt (FunPtr a) = I## (addr2Int## a)
data Arch = ArchSPARC | ArchPPC | ArchX86 | ArchX86_64 | ArchAlpha | ArchARM data Arch = ArchSPARC
| ArchARM64 | ArchPPC64 | ArchPPC64LE | ArchPPC
| ArchX86
| ArchX86_64
| ArchAlpha
| ArchARM
| ArchARM64
| ArchPPC64
| ArchPPC64LE
| ArchUnknown
deriving Show deriving Show
platform :: Arch platform :: Arch
...@@ -81,7 +89,11 @@ platform = ...@@ -81,7 +89,11 @@ platform =
#elif defined(powerpc64le_HOST_ARCH) #elif defined(powerpc64le_HOST_ARCH)
ArchPPC64LE ArchPPC64LE
#else #else
#error Unknown architecture # if defined(TABLES_NEXT_TO_CODE)
# error Unimplemented architecture
# else
ArchUnknown
# endif
#endif #endif
mkJumpToAddr :: EntryFunPtr -> ItblCodes mkJumpToAddr :: EntryFunPtr -> ItblCodes
...@@ -245,6 +257,11 @@ mkJumpToAddr a = case platform of ...@@ -245,6 +257,11 @@ mkJumpToAddr a = case platform of
0x618C0000 .|. lo16 w32, 0x618C0000 .|. lo16 w32,
0x7D8903A6, 0x4E800420 ] 0x7D8903A6, 0x4E800420 ]
-- This code must not be called. You either need to
-- add your architecture as a distinct case or
-- use non-TABLES_NEXT_TO_CODE mode
ArchUnknown -> error "mkJumpToAddr: ArchUnknown is unsupported"
byte0 :: (Integral w) => w -> Word8 byte0 :: (Integral w) => w -> Word8
byte0 w = fromIntegral w byte0 w = fromIntegral w
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment