Use crosstool-NG to create a cross-compilation tool chain in ubuntu12.04.2

Source: Internet
Author: User
Tags automake

In the last two weeks, I finally finished this last night when I got off work.

Crosstool-NG Official Website: http://crosstool-ng.org/

At the beginning, I was prepared to do it on cygwin. The official website was vague, probably because the basic support was quite good, and some strange things occurred. There still are quirks to work around ). Do not believe this evil idea first, because ecos compiled on cygwin are quite smooth. However, some errors have occurred. cygwin has been reinstalled twice. All development tools have been selected and finally failed.

So I decided to install ubuntu and download version 12.04.2. I don't want to use vmware either. I never had vmware ready in the past. I failed to use samba, but I still had a bad configuration. Later I used it directly. Now I don't play games anymore. I just watch movies and write online things on my computer. ubuntu can do a good job and almost replace windows. Install a dual-system and use ubuntu at ordinary times.

Divide the e-disk into 20 GB for ubuntu installation. In the past, a CD was required to install the system. In fact, UltraISO can be used to get the operating system image into a USB flash drive. The BIOS can be set to start from a USB flash drive. The installation process is the same as that of a light drive.

After installing windows and ubuntu, you don't need to select any partitions. After installing and restarting windows, you can choose whether to enter ubuntu or win 7.

Follow the instructions on the official crosstool-NG Website step by step:

wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-VERSION.tar.bz2tar xjf crosstool-ng-VERSION.tar.bz2cd crosstool-ng-VERSION./configure --prefix=/some/placemakemake installexport PATH="${PATH}:/some/place/bin"

There are a lot of problems encountered in this process. You can search online to solve them one by one. The list is as follows:

No bison:

Sudo apt-get install bison flex


No gperf:

Sudo apt-get install gperf


No * info. I forgot what the error is. The last four letters are info:

Sudo apt-get install texinfo


Without GNU awk:

Sudo apt-get install gawk


Without libtool:

Sudo apt-get install libtool


No automake:

Sudo apt-get install automake


No curses header:
Sudo apt-get install libncurses5-dev


During make install, the system prompts that the user cannot be a root user. Because I set./configure -- prefix =/some/place to/etc. If a common user has no permission, the root user is used. This place has been stuck for two days and there are few items related to the Internet. Later, I changed/some/place to my home directory.


The PATH of the common user in ubuntu12.04.2 is changed in the. profile in the HOME directory, so that export is not used every time the terminal is opened.



mkdir /a/directory/to/build/your/toolchaincd /a/directory/to/build/your/toolchainct-ng arm-unknown-linux-gnueabict-ng build


This process also has some problems to solve.


Missing: 'i686-pc-linux-gnu-gcj 'or 'i686-pc-linux-gnu-gcj' or 'gcj': either needed!
Use sudo apt-get install gcj to say that it has been installed. If it has changed several sources, it will still not work. Later
Solution: sudo apt-get install gcj-jdk

Missing: 'i686-pc-linux-gnu-g ++ 'or 'i686-pc-linux-gnu-g ++' or 'G ++ ': either needed!
Solution: sudo apt-get install g ++

I got stuck in Retrieving 'linux-3.7.3 'for a long time. I thought I was missing another one, but I couldn't try any of the methods, it may be downloaded from the Internet. It is a little slower. I went to the gym and kept it running. Later I came back and installed this step.

When cross-gdb is installed for 92nd minutes, [ERROR] appears.
Configure: error: expat is missing or unusable
[ERROR] make [2]: *** [configure-gdb] Error 1
[ERROR] make [1]: *** [all] Error 2
Solution: sudo apt-get install libexpat1-dev

The ct-ng build process took two or three hours and was finally installed. You can use the following PATH to modify the PATH.


export PATH="${PATH}:${HOME}/x-tools/arm-unknown-linux-gnueabi/bin"arm-unknown-linux-gnueabi-gcc

This article from the "Xu Shu Gao shun" blog, please be sure to keep this source http://mantis.blog.51cto.com/5044560/1275344

Related Article

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.