Based on Ubuntu8.10: Build a cross-compiling environment for Embedded Linux

Source: Internet
Author: User
Before embedded development, you must first establish a cross-compilation environment, which is a development environment consisting of a set of compilers, connectors, and libc libraries. This article describes the establishment process and operation steps of the embedded cross-compilation environment, hoping to help you build the corresponding cross-compilation environment. I. Required software and hardware environment ■ host environment to establish the cross-compilation tool chain of the host environment: Ubuntu8.10, gcc-4.3.2 ■ Ubuntu8.10 software environment to ensure your Ubuntu8

Before embedded development, you must first establish a cross-compilation environment, which is a development environment consisting of a set of compilers, connectors, and libc libraries. This article describes the establishment process and operation steps of the embedded cross-compilation environment, hoping to help you build the corresponding cross-compilation environment.

I. Required Software and Hardware Environments

■ Host environment

Create a host environment for the cross-compilation tool chain:

Ubuntu 8.10, gcc-4.3.2

■ Ubuntu 8.10 software environment

Make sure that the following software is installed on your Ubuntu 8.10:

Bison flex build-essentials patch libncurses5-dev

Install these software packages:

Sudo apt-get install Bison flex build-essential patch libncurese5-dev

Or directly download the following deb Software Package

Bison_13a2.3.dfsg-4build1_i386.deb

Build-essential_11.4_i386.deb

Flex_2.5.33-10build1_i386.deb

Libncurses5-dev_5.6 + 20071124-1ubuntu2_i386.deb

M4_1.4.8-1build1_i386.deb

Patch_2.5.9-5_i386.deb

Then sudo dpkg-I *. deb install these packages.

■ Related software packages

The software packages selected in this solution are as follows:

Gcc-3.4.5.tar.gz

Glibc-2.3.6.tar.gz

Linux-2.6.26.5.tar.gz

Crosstool-0.43.tar.gz

Binutils-2.15.tar.gz

Glibc-linuxthreads-2.3.3.tar.gz

Linux-libc-headers-2.6.12.0.tar.bz2

II. Specific steps

1. Modify system configurations

1.1, Ubuntu 8.10 default installed gcc version 4.3.2, this version for syntax requirements are higher, compilation will be wrong, currently not suitable for choice, so select the gcc-4.1.1, but do not need to uninstall the gcc-4.3.2.

(1) Method 1: Enter the installation gcc-4.1 directly on the terminal

Sudo apt-get install gcc-4.1

(2) Method 2: download the following software packages:

Gcc-4.1_4.1.2-23ubuntu3_i386.deb

Gcc-4.1-base_4.1.2-23ubuntu3_i386.deb

Cpp-4.1_4.1.2-23ubuntu3_i386.deb

Then sudo dpkg-I *. deb

Install

Sudo rm/usr/bin/gcc (delete GCC, it's just a soft link file to the gcc-4.3.2)

Sudo ln-s/usr/bin/gcc-4.1/usr/bin/gcc (create a soft link from GCC to gcc-4.1)

1.2. Modify the sh version

If you run

Ls-la/bin/sh

If the link is dash, run the following command:

Sudo dpkg-reconfigure dash

Select no to delete dash

If this parameter is not modified, an error occurs during compilation.

2. decompress the software package and enter the directory to view important script files.

$ Cd downloads

$ Tar-zxvf crosstool-0.43.tar.gz

$ Crosstool-0.43 cd

There are many. sh scripts and. dat configuration files in this directory. Each supported processor has its corresponding scripts. If you choose demo-arm-softfloat.sh is to establish the target to support soft floating point arm cross compilation tool chain.

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.