Cross compiling on a Debian VMware machine for the Beaglebone Black

Installed Debian Linux on PC running VMware using image:

Change screen resolution to match system:

Menu: Applications/System Tools/Preferences/System Settings
Click Displays
Change resolution and press Apply

 Add your standard user to the sudoer’s list:

su root

add the following line after the specification for the root user:

username     ALL=(ALL:ALL) ALL

Press <CTRL> O  to save, then <CTRL> X  to exit

The rest of the instructions on this page are to be done as the root user.
Either remain as root user from the above “su root” command, or prepend “sudo ” to every linux command listed below.

 Update system:

apt-get update
apt-get upgrade

Install basic development tools:

apt-get install build-essential

Install cross-compile utilities

nano /etc/apt/sources.list

Add the lines:

deb unstable main
deb unstable main contrib non-free

Install emdebian key signatures:

apt-get install emdebian-archive-keyring
apt-get update

Install cross compile tools:

apt-get install libc6-armhf-cross libc6-dev-armhf-cross
apt-get install binutils-arm-linux-gnueabihf linux-libc-dev-armhf-cross
apt-get install libstdc++6-armhf-cross
apt-get install gcc-4.7-arm-linux-gnueabihf g++-4.7-arm-linux-gnueabihf

Remove emdebian keyring:

nano /etc/apt/sources.list

Comment out the lines (add # to start of each line):

deb unstable main
deb unstable main contrib non-free
apt-get remove emdebian-archive-keyring
apt-get update

Make links to executables in /usr/bin:

ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc
ln -s /usr/bin/arm-linux-gnueabihf-g++-4.7 /usr/bin/arm-linux-gnueabihf-g++


Leave a Reply

Your email address will not be published. Required fields are marked *