Create an ARMGCC cross compiler under Ubuntu10.04

Source: Internet
Author: User
I started to learn how to build an ARMGCC cross-compiling environment in Linux. I used Ubuntu10.04. As a result, I encountered a lot of problems. Later I found a lot of information on the Internet and finally succeeded today. Below is a simple compilation tutorial, hoping to help you: preparation: 1. download the tool for creating a cross-compilation environment: crosstool(crosstool-0.43.tar.gz) and use the command line to download wgethttp: // www. kegel

I started to learn how to build an arm gcc cross-compiling environment in Linux. I used the Ubuntu 10.04 system. As a result, I encountered a lot of problems and found a lot of information on the Internet, today we finally succeeded. Below is a simple compilation tutorial, hoping to help you:

Preparations:

1. Download the tool used to create a cross-compilation environment: crosstool(crosstool-0.43.tar.gz)

Use command line download

Wget http://www.kegel.com/crosstool/crosstool-0.43.tar.gz

2. Download the source code required for the compilation process:

Binutils-2.15.tar.bz2

Gcc-3.4.5.tar.bz2

Glibc-2.3.6.tar.bz2

Glibc-linuxthreads-2.3.6.tar.bz2

Linux-2.6.8.tar.bz2

Linux-libc-headers-2.6.12.0.tar.bz2

Note: The specific version numbers may be different. We will talk about how to set them later.

We recommend that you store the above seven software in the same directory, for example ~ /Linux/download directory.

3. the compilation process requires the following software. The system itself is not installed. You can run the installation command in advance, because it takes at least half an hour to compile, if the dependent software is not installed, an error will be reported and exited. It is a waste of time.

Sudo apt-get install bison flex build-essential patch libncurses5-dev

Procedure:

1. Modify system configurations

1.1 set the GCC version to 4.1

Ubuntu 10.04 by default installed gcc version is 4.4, this version for syntax requirements are high, compilation will be wrong, currently not recommended, so select the gcc-4.1, but do not need to uninstall the gcc-4.4.

Sudo apt-get install gcc-4.1

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. Www.linuxidc.com if demo-arm-softfloat. sh is used, it is used to establish an arm cross-compilation tool chain with the goal of supporting soft floating points.

3. Modify demo-arm-softfloat.sh

$ Vim demo-arm-softfloat.sh.

Modify the following two statements:

TARBALLS_DIR = $ HOME/downloads // indicates the directory where the downloaded source code is stored.

RESULT_TOP =/opt/crosstools // indicates the directory where the generated toolchain is stored.

Is:

TARBALLS_DIR =/home/linux/downloads (source code directory)

RESULT_TOP =/home/linux/crosstools (generate tool chain directory)

4. Modify gcc-3.4.5-glibc-2.3.6.dat

$ Vim gcc-3.4.5-glibc-2.3.6.dat.

The modified content is as follows:

BINUTILS_DIR = binutils-2.15

GCC_DIR = gcc-3.4.5

GLIBC_DIR = glibc-2.3.6

LINUX_DIR = linux-2.6.26.5

LINUX_SANITIZED_HEADER_DIR = linux-libc-headers-2.6.12.0

GLIBCTHREADS_FILENAME = glibc-linuxthreads-2.3.6

5. $./demo-arm-softfloat.sh

This process is relatively long (about half an hour)

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.