Ubuntu10.04crosstool-0.43 build a cross-compilation environment

Source: Internet
Author: User
Ubuntu 10.04 was installed today and encountered some problems when creating a cross-compilation environment. First ensure that the system has the following software: Bison, flex, build-essential, patch, libncurses5-de (1) first GCC down to 4.1. Sudoapt-getinstallgcc-4.1sudorm/usr/bin/gccsudoln-s/usr/bin/gcc-

I installed Ubuntu 10.04 today and encountered some problems when creating a cross-compilation environment.

Make sure that the system has the following software:

Bison, flex, build-essential, patch, libncurses5-de

(1) first, reduce GCC to 4.1.

Sudo apt-get install gcc-4.1

Sudo rm/usr/bin/gcc

Sudo ln-s/usr/bin/gcc-4.1/usr/bin/gcc

Crosstool detects

If the gcc version is later than 4.1, an error is returned.

(2) modify the sh version and change dash to bash.

Ls-la/usr/bin run if the linked dash

Sudo dpkg -- reconfigure dash

Select no to delete dash. (After creating a cross-compilation environment, you can run this command to select yes to install dash ).

(3) decompress the crosstool source code package and modify the configuration file.

Modify the demo-arm-softfloat.sh file.

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.

You can modify it based on your actual situation.

This solution requires the following software packages:

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

Modify related file gcc-3.4.5-glibc-2.3.6.dat

You only need to match the source code versions in the file with the source code package.

(4) Run./demo-arm-softfloat.sh

After running for a short time, the following error message is displayed:

* ** These critical programs are missing or too old: as ld.

In fact, this problem is the same as downgrading the gcc version. It is not because the as and ld versions are too low, but crosstool versions are higher. Both as and ld are tools in binutils. Prior to 9.04, binutils versions were earlier than 2.20, and there were restrictions on related configure files in crosstool. However, the binutils version in 10.04 is 2.20, and crosstool simply says that the as and ld versions are too low to create a cross-compilation environment.

My solution is to binutils version 2.18 On www.gnu.org and then replace version 2.20 in the system. The method is as follows:

Decompress the source package

Cd binutils-2.18

./Configure -- prefix =/tmp/binutils -- disable-nls (-prefix is followed by the location where the generated executable file is stored and can be customized)

Make all

Make install

After compilation, the executable files of the ld as program are generated in/tmp/binutils/bin /.

Relink/usr/bin/ld to the/usr/bin/as file

Sudo rm/usr/bin/ld/usr/bin/

Sudo ln-s/tmp/binutils/bin/ld/usr/bin/ld

Sudo ln-s/tmp/binutils/bin/as/usr/bin/

Then run ld-v and as-v to check if the version is 2.18.

Then run the crosstoll-0.43 under the demo-arm-softfloat.sh directory to successfully establish the cross-compilation environment.

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.