How to cross-compile with GNU autotools for armv5tel?
arm, autotools, cross-compiling, gcc, segmentation-fault
Solution
Apparently my cross-compile toolchain was not the right one. I ended up using crosstool-ng. Btw it's very simple to use and a great tool, all you have to do is to choose the right toolchain for your device.
I have built an `arm-unknown-linux-uclibcgnueabi` toolchain with crosstool-ng, which solved my problem.
Problem
I have an ARM machine that runs Linux (BusyBox). ``` # uname -a # Linux XXXXXXXX 2.6.28 #1 PREEMPT Fri Sep 26 22:47:38 UTC 2014 armv5tel GNU/Linux ``` I've cross-compiled a simple program on my Ubuntu 32-bit desktop: ``` ./configure --host=arm-linux-gnueabi LDFLAGS="-static" make ``` But when I try to run it on the ARM machine, it gives me Segmentation Fault error. Program is super simple: ``` #include <stdio.h> int main() { printf("Hello, World!"); return 0; } ``` Here are a few things I've already tried/checked: - I've checked md5 hashes on both machines to eliminate the possibility that something went wrong at the time of copying an executable over the network - Stripped the executable with `arm-linux-gnueabi-strip`. I was comparing my executable with another executable that was already in the target machine with `file`: `# file my_program` `# my_program: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.31, BuildID[sha1]=0x4b1f2773e54b141d5157b86f0f10438a372625c9, stripped` `# file their_program` `# their_program: ELF 32-bit LSB executable, ARM, version 1 (GNU/Linux), statically linked, stripped` What am I doing wrong?