Building a cross-compiler for ARM
ricardo.wurmus at gmail.com
Sun Feb 19 11:02:07 CET 2012
I've been trying to build GHC 7.4.1 from source with Stephen
Blackheath's patches to get a cross-compiler for ARM. GHC fails to
compile with these errors:
In file included from includes/Rts.h:208:0,
includes/rts/OSThreads.h:33:1: error: unknown type name 'pthread_cond_t'
includes/rts/OSThreads.h:34:1: error: unknown type name 'pthread_mutex_t'
includes/rts/OSThreads.h:35:1: error: unknown type name 'pthread_t'
includes/rts/OSThreads.h:36:1: error: unknown type name 'pthread_key_t'
includes/rts/OSThreads.h:57:36: error: unknown type name 'pthread_mutex_t'
includes/rts/OSThreads.h:58:36: error: unknown type name 'pthread_mutex_t'
Here's what I did:
- applied the patches
- ran autoreconf to generate a new configure script
- ./configure --target=arm-linux-gnueabi --with-alien=~/bin/alien
`~/bin/alien` is an adapted script of Stephen's alien script that
executes ARM executables with qemu-arm and the ARM system libraries
that I extracted from the armv5t filesystem here when the first
argument is "run".
`arm-none-eabi-gcc` is a working cross-compiler for ARM.
Both host (x86_64-unknown-linux) and target (arm-linux-gnueabi)
"include" directories have the `pthread.h` header file as well as
`sys/types.h` which defines the above names that are declared missing.
Has anyone succeeded in building a cross-compiler with these patches
yet? I'm almost certain there's just a simple flag or environment
variable missing somewhere in my invocation of the configure script.
I'd appreciate any comments.
More information about the Cvs-ghc