[Haskell-cafe] generating object file for ARM

Karel Gardas karel.gardas at centrum.cz
Sat Feb 6 15:34:00 UTC 2016


Your ghc is your native (amd64) compiler (provided by debian as a 
package)? If so, then this is not supported. You need to compile ghc 
from source and configure it as a cross-compiler. Another problem is 
that armv7-m supports only thumb-2 isns while GHC HEAD IIRC switched to 
arm isns solely. The last problem may be lack of support for armv7-m in 
GHC's RTS (runtime) or for your (probably?) RTOS which you run on armv7-m?

Karel

On 02/ 6/16 04:19 PM, Fabien R wrote:
> Hello,
>
> I would like to link my Haskell module with existing object files for
> armv7-m. I use ghc 7.4.1 on debian/amd64.
>
> This command seems incorrect or incomplete:
> ghc -pgmcarm-none-eabi-gcc -pgmParm-none-eabi-cpp -pgmaarm-none-eabi-as
> -pgmlarm-none-eabi-ld  -keep-tmp-files  HaskellModule.hs
>
> A lot of errors appeared:
> [1 of 1] Compiling HaskellModule    ( HaskellModule.hs, HaskellModule.o )
> /tmp/ghc13654_0/ghc13654_0.s: Assembler messages:
>
> /tmp/ghc13654_0/ghc13654_0.s:5:0:
>       Error: unrecognized symbol type ""
>
> /tmp/ghc13654_0/ghc13654_0.s:17:0:
>       Error: unrecognized symbol type ""
>
> /tmp/ghc13654_0/ghc13654_0.s:29:0:
>       Error: bad instruction `leaq -40(%rbp),%rax'
>
> /tmp/ghc13654_0/ghc13654_0.s:30:0:
>       Error: bad instruction `cmpq %r15,%rax'
>
> Any hints ?
>



More information about the Haskell-Cafe mailing list