I'm trying to cross-compile from my Ubuntu 14.04 (host) to the pi zero. Here is what I've done on host to cross compile a very basic example :
> apt-get install g++-arm-linux-gnueabihf
from here
Then created a simple test.cpp :
#include <iostream>
int main() {
std::cout << "hello world" << std::endl;
return 0;
}
Then
> arm-linux-gnueabihf-g++ -marm -mtune=arm1176jzf-s -march=armv6 test.cpp
Finally copy and paste the exec on my pi zero, execute it, and get a SEGFAULT error... No way to get more, even with gdb
option.
I guess this comes from a bad cross compiler option, the exec seems to be not readable from the broadcom 2835 . But I've tried all cross-compiler options (arm-linux-gnueabihf-g++ -v
) that could arrange that without successing...
Anyone has already done some cross compilation to the pi zero and could help ?
Thanks a lot