How to install the Raspberry Pi cross compiler on my Linux host machine?

I’m gonna try to write this as a tutorial for you so it becomes easy to follow. NOTE: This tutorial only works for older raspbian images. For the newer Raspbian based on Debian Buster see the following how-to in this thread: https://stackoverflow.com/a/58559140/869402 Pre-requirements Before you start you need to make sure the following is installed: … Read more

What’s the difference of “./configure” option “–build”, “–host” and “–target”?

As noted in this blog post and alluded to in the GCC Configure Terms, –target only applies when you are compiling toolchains. When you are doing normal cross-compilation of a library or binary you use –build=the architecture of the build machine –host=the architecture that you want the file to run on However, when you are … Read more

Cross compile Go on OSX?

With Go 1.5 they seem to have improved the cross compilation process, meaning it is built in now. No ./make.bash-ing or brew-ing required. The process is described here but for the TLDR-ers (like me) out there: you just set the GOOS and the GOARCH environment variables and run the go build. For the even lazier … Read more

Error “gnu/stubs-32.h: No such file or directory” while compiling Nachos source code

You’re missing the 32 bit libc dev package: On Ubuntu it’s called libc6-dev-i386 – do sudo apt-get install libc6-dev-i386. See below for extra instructions for Ubuntu 12.04. On Red Hat distros, the package name is glibc-devel.i686 (Thanks to David Gardner’s comment). On CentOS 5.8, the package name is glibc-devel.i386 (Thanks to JimKleck’s comment). On CentOS … Read more

Missing include “bits/c++config.h” when cross compiling 64 bit program on 32 bit in Ubuntu

Adding this answer partially because it fixed my problem of the same issue and so I can bookmark this question myself. I was able to fix it by doing the following: sudo apt-get install gcc-multilib g++-multilib If you’ve installed a version of gcc / g++ that doesn’t ship by default (such as g++-4.8 on lucid) … Read more