Unfortunately, I am having difficulty cross-compiling Git for the ARMv6 architecture.
But before I begin describing the steps I've taken and commands I've entered, I should briefly describe the build environment:
- I am cross-compiling on Ubuntu 12.10 64-bit.
- The cross compiler is installed to
/home/my_name/cctoolchain
(this directory containsbin/
,lib/
, etc.).
I began by grabbing Git 1.8.2 from here. After extracting the directory I ran:
export PATH=$PATH:/home/my_name/cctoolchain/bin
I also ran autoconf
to make sure that ./configure
was up to date. Then I invoked ./configure
as follows:
./configure --prefix=/home/my_name/git-arm --build=x86_64-linux-gnu --host=arm-linux-androideabi
This ran for a couple of seconds and then aborted with:
checking whether system succeeds to read fopen'ed directory... configure: error: in `/home/my_name/git-1.8.2': configure: error: cannot run test program while cross compiling
I cracked open configure.ac
and removed lines 806-825, disabling the test. After doing that, I also had to remove lines 806-839 for a similar reason.
At this point, the ./configure
script was able to complete. I then excitedly ran make
to build Git and after a few more moments, ran into this error:
fetch-pack.c: In function 'fetch_pack': fetch-pack.c:928:16: error: 'struct stat' has no member named 'st_mtim' make: *** [fetch-pack.o] Error 1
Somehow I get the feeling I'm "doing it wrong". This sounds like something that should be a lot easier than manually removing tests from configure.ac
. What am I missing?
CC=armv7l-timesys-linux-gnueabi-gcc CFLAGS="--sysroot=/home/mmes/projects/arm-cross-sdk/tags/0.1.8" LDFLAGS="--sysroot=/home/evadeflow/projects/arm-cross-sdk/tags/0.1.8" ./configure --prefix=/home/evadeflow/git-arm --build=i386-linux-gnu --host=armv7l-timesys-linux-gnueabi
. (The--sysroot=
arg shouldn't be necessary for most people.) I also had to comment out some tests inconfigure.ac
as you described (ac_cv_fread_reads_directories
andac_cv_snprintf_returns_bogus
), and runmake configure
afterwards. – Blackfellow