Moto Linux Application Development (-): Build the moto E6 cross-compilation tool chain on Ubuntu

Source: Internet
Author: User

Article Source: http://blog.csdn.com/keensword007
Contact information: Qin Jian <keensword007 at Sina dot com>

Recently, helix player needs to be transplanted to the Linux mobile phone of Moto, and the development machine obtained is Moto e6.

E6 is a 2.4 kernel arm system Linux. First, I had some basic knowledge of the major forums,This document is a comprehensive summary of the Quick Start Guide for new users of E6. We recommend that you take a look at the moto mobile phone for the first time. 

To develop a program, you must first cross-compile the tool chain. Some documents have been found online, and some toolchains have been sorted out. The well-known toolchain is release_yan0.rar, which is used by the a1200/e6. unfortunately, the download link has expired and Google has a hand, no download location found. You can only give up. I finally chose the ezx-crosstool-0.6 (the latest version at the time of writing, which can be downloaded here), because it is easier to understand. After decompression, run build. Sh to download the required components and compile them automatically. The compiled cross-compilation toolchain is an old version. The corresponding version is binutils 2.15.

GCC 3.3.6

Glibc 2.3.2

Glibc-linuxthreads 2.3.2

Linux 2.4.26

Before Running build, install the flex and bison packages.

Under Ubuntu
Sudo apt-Get install flex bison

You can. Compilation still fails after installation. The error message for this time is:

In file encoded ded from/usr/include/fcntl. h: 217, from/home/chenzhengyong/ezx-crosstool-0.5/build/ARM-Linux/gcc-3.3.6-glibc-2.3.2/gcc-3.3.6/GCC/system. h: 208, from/home/chenzhengyong/ezx-crosstool-0.5/build/ARM-Linux/gcc-3.3.6-glibc-2.3.2/gcc-3.3.6/GCC/collect2.c: 30: In function 'open ', inlined from 'Collect _ execute 'At/home/chenzhengyong/ezx-crosstool-0.5/build/ARM-Linux/gcc-3.3.6-glibc-2.3.2/gcc-3.3.6/GCC/collect2.c: 1575:/usr/include/bits/fcntl2.h: 51: Error: Call to '_ open_missing_mode' declared with attribute error: open with o_creat in second argument needs 3 argumentsmake [1]: * ** [collect2.o] Error 1 make [1]: leaving directory '/home/chenzhengyong/ezx-crosstool-0.5/build/ARM-Linux/gcc-3.3.6-glibc-2.3.2/build-gcc-core/GCC 'make: *** [All-GCC] Error 2

Because ubuntu9.10 comes with a gcc-4.3.2, this version of the compiler checks compilation issues more strictly, so you must install the gcc-4.1, but do not have to uninstall 4.3.2. The method is to install the gcc-4.1 with the new software package manager, after

Sudo RM/usr/bin/GCC (delete GCC, it's just a soft connection file to the gcc-4.3.2)
Sudo ln-S/usr/bin/gcc-4.1/usr/bin/GCC (build a soft connection from GCC to gcc-4.1)

In addition, if you run
Ls-La/bin/sh
Command, you will see that/bin/sh is actually a soft link to dash, please run the following command to link/bin/sh to bash.
Sudo mV/bin/sh. Old
Sudo ln-SF bash/bin/sh

Run build. Sh again. At this time, you should get a compilation environment that can be used for cross-compilation. If you have not modified the result_top variable in build. Sh, it should be in the ezx-crosstool-0.6/GCC-arm-iwmmxt directory. With this cross-compilation environment, we can compile the program on the mobile phone theoretically. Perform a test first.
Write a classic program test. C:
# Include <stdio. h>

Int main (INT argc, char * argv [])
{
Printf ("Hello world, Moto E6! /N ";
}

Then compile:

First, set the path:

Path = $ path :~ /Mkezx/ARM/GCC/gcc-3.3.6-glibc-2.3.2/ARM-Linux/bin

Then run the compilation command:

Arm-Linux-gcc-O test. c

Then copy the generated test to the mobile phone and run it with ekonsole./test. The output is Hello world, Moto E6!

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.