Cross compiling for Cortex A9

Michael Jones mike at proclivis.com
Sat Aug 2 22:04:25 UTC 2014


Karel,

My configure hack is now limited to two hacks on GHC 7.8.3. The vendor “pokey", and the ARM settings that make the target architecture correct. I also enabled profiling in build.mk. So pretty clean. No compiler options. GHC compiles clean.

I am getting a stack overflow during execution of the hello world applicaiton. I compiled like:

arm-poky-linux-gnueabi-ghc -static -debug -auto-all -caf-all -prof Main.hs

I ran on the target like:

./Main +RTS -Ds -Di -Db -DS -Dt -Da 2>log

I attached a log. Search for overflow.

created capset 0 of type 2
created capset 1 of type 3
cap 0: initialised
assigned cap 0 to capset 0
assigned cap 0 to capset 1
free block list [0]:
free block list [1]:
free block list [2]:
free block list [3]:
free block list [4]:
free block list [5]:
free block list [6]:
group at 0x76c82000, length 126 blocks
free block list [7]:
free block list [8]:
free block list [0]:
free block list [1]:
free block list [2]:
free block list [3]:
free block list [4]:
free block list [5]:
free block list [6]:
group at 0x76c82000, length 126 blocks
free block list [7]:
free block list [8]:
free block list [0]:
free block list [1]:
free block list [2]:
free block list [3]:
free block list [4]:
free block list [5]:
free block list [6]:
group at 0x76c82000, length 125 blocks
free block list [7]:
free block list [8]:
free block list [0]:
free block list [1]:
free block list [2]:
free block list [3]:
free block list [4]:
free block list [5]:
free block list [6]:
group at 0x76c82000, length 124 blocks
free block list [7]:
free block list [8]:
free block list [0]:
free block list [1]:
free block list [2]:
free block list [3]:
free block list [4]:
free block list [5]:
free block list [6]:
group at 0x76c82000, length 123 blocks
free block list [7]:
free block list [8]:
free block list [0]:
free block list [1]:
free block list [2]:
free block list [3]:
free block list [4]:
free block list [5]:
free block list [6]:
group at 0x76c82000, length 122 blocks
free block list [7]:
free block list [8]:
new task (taskCount: 1)
cap 0: created thread 1
new bound thread (1)
cap 0: schedule()
cap 0: running thread 1 (ThreadRunGHC)
stg_ap_v_ret... PAP/1(0x5ba25a, 0x5a3670)
stg_ap_0_ret... base:GHC.MVar.MVar(0x76c020d4)
stg_ap_v_ret... <Main.main>(0xa964, CAF:main)
stg_ap_v_ret... PAP/1(0x5bce1a, 0x76c02160)
stg_ap_0_ret... ghc-prim:GHC.Tuple.(,)(0x76c021a9, 0x76c0219a)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c023d1, 0x76c023be)
cap 0: thread 1 stopped (yielding)
cap 0: running thread 1 (ThreadRunGHC)
stg_ap_0_ret... base:GHC.IO.Encoding.Types.TextEncoding(0x5aadd0, 0x76c026c5, 0x76c02665)
stg_ap_v_ret... <GHC.IO.Encoding.getForeignEncoding>(0x59458, CAF)
stg_ap_0_ret... ghc-prim:GHC.Tuple.(,)(0x76c029a1, 0x76c02992)
stg_ap_0_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_0_ret... base:GHC.IO.Encoding.Types.TextEncoding(0x5aadd0, 0x76c02aa1, 0x76c02a41)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c023d1, 0x76c02b40)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c023ad, 0x76c02ba8)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c02389, 0x76c02c10)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c02365, 0x76c02c78)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c02341, 0x76c02ce0)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c0231d, 0x76c02d48)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c022f9, 0x76c02db0)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c022d5, 0x76c02e18)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c022b1, 0x76c02e80)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c0228d, 0x76c02ee8)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c02269, 0x76c02f50)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c02245, 0x76c02fb8)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c02221, 0x76c0502c)
stg_ap_0_ret... ghc-prim:GHC.Types.:(0x76c021fd, 0x76c05094)
stg_ap_0_ret... ghc-prim:GHC.Types.[]()
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02b14)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02b7c)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02be4)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02c4c)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02cb4)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02d1c)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02d84)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02dec)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02e54)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02ebc)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02f24)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c02f8c)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c05000)
stg_ap_0_ret... THUNK_SELECTOR(0x46ee50, CAF, 0x76c05068)
stg_ap_0_ret... ghc-prim:GHC.Types.[]()
stg_ap_v_ret... IND_STATIC(0x76c0360c)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_v_ret... IND_STATIC(0x76c0360c)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_v_ret... IND_STATIC(0x76c0360c)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_v_ret... IND_STATIC(0x76c0360c)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_v_ret... IND_STATIC(0x76c0360c)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
stg_ap_v_ret... IND_STATIC(0x76c0360c)
stg_ap_v_ret... FUN/1(0x59088, CAF, 0x76c02980)
cap 0: thread 1 stopped (stack overflow)
On Aug 2, 2014, at 12:07 PM, Karel Gardas <karel.gardas at centrum.cz> wrote:

> On 08/ 2/14 07:04 AM, Michael Jones wrote:
> 
>>  ,("target arch","ArchARM {armISA = ARMv7, armISAExt = [VFPv3,NEON], armABI = HARD}")
>>  ,("target word size","4")
> 
> this looks good, but I hope you got it on clean tree, i.e. without your configure hack...
> 
> Karel




More information about the Glasgow-haskell-users mailing list