Recently I tried to make my own cross-compile toolchain for a arm platform. I noticed with the autoconf script of GCC, I have to pass variables like:
--with-cpu=cortex-m4 \
--with-fpu=fpv4-sp-d16 \
--with-float=hard \
--with-mode=thumb \
So it seems different ARM platforms should have different tool chain/compiler cause I have to configure the cpu, fpu etc. But then I found there's some sort of pre-made binaries of these tool chain.
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
I tried this tool chain and compiled a hello world program and tried it on my target ARM board, then it shows "segmentation fault." OK, at least it's not "cannot execute binary file: Exec format error"
But I am still wondering, how come it does not work? Or is it suppose to work actually?