"Original" http://blog.csdn.net/gubenpeiyuan/article/details/7895469
Because it is necessary to compile the program locally and run it on the embedded system, the compiler needs to be installed locally, and the main requirement is MIPSEL-LINUX-GCC.
Before always thought can use Apt-get install find, results find for a long time to find, found or have to make up their own.
1. Environment
System: Ubuntu 16.04
Software: BuildRoot
The software can compile the C compiler for MIPS, ARM and so on.
2. Download
wget http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2
TAR-JXVF buildroot-snapshot.tar.bz2
CD BuildRoot
You can also go directly to the official website https://buildroot.org download the latest;
3. Configure BuildRoot
Make clean
Make Menuconfig
A selection menu appears, such as:
Select the first "Target Architecture" and Change to MIPS (little endian)
Also, select "Toolchain" to change "kernel headers" to the Linux version on your host (and the host running the compiler)
Can be viewed on the host via Uname-r or cat/proc/version.
Native is only the GCC section, there is no g++ part, need to compile C + + program, then select the Enable C + + option in the menu (select by Y).
4. Compiling
Because of the need for networking to download some files, so the host needs networking;
Need to install the bision, Flex, TextInfo, ncurses and other libraries in advance.
sudo apt-get install Texinfo flex bison libncursesn5-dev Patch GetText g++
Then Make-j compiles.
5. Results
The final result is in the Buildroot/output/host/usr/bin directory, such as:
Setting up MIPS cross-compilation environment under Ubuntu