Jessie armhf Cross Compile
From embeddedTS Manuals
- Run "lsb_release -a" and verify Debian 8.X is returned. These instructions are not
- expected to work on any other version or distribution.
apt-get install curl build-essential
su root echo "deb http://emdebian.org/tools/debian jessie main" > /etc/apt/sources.list.d/emdebian.list curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add - dpkg --add-architecture armhf apt-get update apt-get install crossbuild-essential-armhf
- This will install a toolchain you can use with the prefix:
- "arm-linux-gnueabihf-"
- eg, arm-linux-gnueabihf-gcc, arm-linux-gnueabihf-g++, etc
- You can test out thet toolchain with a hello world. Create your hello-world.c with your preferred editor
vim hello-world.c arm-linux-gnueabihf-gcc hello-world.c -o hello-world file hello-world
- This will return that the binary created is for ARM. Copy this to the armhf distribution to run it there
- Now to link to a shared library from the Debian environment. Make sure this
- is installed on both your x86 system, and the board.
apt-get install libcurl4-openssl-dev:armhf
- Download the simple.c example from curl:
wget https://raw.githubusercontent.com/bagder/curl/master/docs/examples/simple.c
- After installing the supporting library, curl will link just as compiling on the unit.
arm-linux-gnueabihf-gcc simple.c -o simple -lcurl