1) For Ubuntu 14.04 x86: retrieve a 32 bits Linux toolchain from Linaro - note that latest releases
are providing Linux x86_64-hosted toolchains only - I tested on a Live CD Lubuntu x86 14.04 image.
wget https://releases.linaro.org/14.01/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.01_linux.tar.xz
tar Jxf gcc-linaro-arm-linux-gnueabihf-4.8-2014.01_linux.tar.xz
export PATH=$(pwd)/gcc-linaro-arm-linux-gnueabihf-4.8-2014.01_linux/bin:$PATH
1.1) create hello.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
printf("Hello, World!\n");
return EXIT_SUCCESS;
}
1.2) compilation
arm-linux-gnueabihf-gcc -o hello hello.c
1.3) execution (on a nanopi-m1 running Armbian 5.16, but it should work as is on an orangepi-one...)
./hello
Hello, World!
2) For Ubuntu 14.04 x86_64: retrieve latest 64 bits Linux toolchain from Linaro - I tested on a Live CD Lubuntu 14.04 x86_64 image.
wget https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
tar Jxf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
export PATH=$(pwd)/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin:$PATH
go through steps 1.1, 1.2, 1.3.
Working fine with Armbian_5.14_Nanopim1_Debian_jessie_3.4.112.raw as well, still on a nanopi-m1.