Setting up MIPS cross-compilation environment under Ubuntu

Source: Internet
Author: User

"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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.