Cross compiling on 64bit machines, error in GitHub docs causes failure (fixed)

@emlid4 Just informing you of an error in the documentation of the GitHub “emlid/linux-rt-rpi” repository (here because “Issues” are not enabled on that site). Basically the wrong cross-compiler is being used on 64bit installs, and newer kernels like Linux 3.19 in Ubuntu 15 will fail with “command not found” errors if you try it.

This article below is an excellent summary and example of cross-compiling for Raspberry Pi. It was only when I read that I realized what the cause of the fault was (the error message returned by gcc/make was useless):

http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/

In short, when your development OS is installed as 64bit (quite common nowadays) you MUST use (export CROSS_COMPILE=…) the Raspbian cross-compiler in the OTHER directory “…rasbian-x64/bin/…”. The documentation in the README.MD file of the Emlid GitHub source does not state this important point.

For some weird reason it worked on Ubuntu 14 (also 64bit) so I had no idea something was wrong until the upgrade. Maybe it has something to do with the older Linux kernel 3.18 allowing it to occur, but then I worry about the stability of what is produced from that compilation! Of course Raspbian put the 64bit cross-compiler there for a reason.

So please update the documentation when you can. For anyone with Ubuntu 15 here’s a post to tell you why it wasn’t working :slight_smile: Personally if this affects you (having a 64bit development machine) I’d go back and recompile everything you did with the wrong compiler, could explain some strange runtime errors 8-{

@CodeChief

Thanks for the report. We’ll fix it as soon as possible.

I guess we’ve modified the export with the x64-version kind of on autopilot.

By the way, while Issues section is missing, there is always a possibility of making a PR :smiley:

1 Like