Guide to making ARM Linux cross-compilation toolchain

Publisher:devilcoreLatest update time:2016-06-17 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Before making it, make sure you have the following tools on your machine: bison flex build-essential.

build-essential is mainly used to provide necessary compilation resources such as GCC and GLIBC. Generally, developers should have them on their machines. If not, for UBUNTU users: sudo apt-get install build-essential bison flex, other users can do it on their own!

1. Download crosstool-0.43.tar.gz from http://kegel.com/crosstool and unzip it and save it in $HOME.

If you want the toolchain on arm9tdmi (the method for other toolchains is the same), enter the crosstool-0.43 directory and open demo-arm9tdmi.sh with a text editor. The content is as follows:

#!/bin/sh
# This script has one line for each known working toolchain
# for this architecture. Uncomment the one you want.
# Generated by generate-demo.pl from buildlogs/all.dats.txt

set -ex
TARBALLS_DIR=$HOME/downloads //This line indicates the storage directory of the tool source code compression package you are about to download!
RESULT_TOP=/opt/crosstool //This line indicates the storage directory of the toolchain to be generated. It is best to change it to a directory with write permission!
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++" //This line indicates the types of languages ​​supported by the toolchain to be generated!
export GCC_LANGUAGES

# Really, you should do the mkdir before running this,
# and chown /opt/crosstool to yourself so you don't need to run as root.
mkdir -p $RESULT_TOP

#eval `cat arm9tdmi.dat gcc-3.2.3-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.2.3-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.3.6-glibc-2.2.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.3.6-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.3.6-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.2.5.dat` sh all.sh --notest #eval
` cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.2.dat` sh all.sh --notest #eval `cat arm9tdmi.dat gcc-
3.4.5-glibc-2.3.2-tls.dat` sh all.sh --notest #eval
`cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-3.4.5-glibc-2.3.5-tls.dat` sh all.sh --notest #eval `cat arm9tdmi.dat
gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest #eval `cat arm9tdmi.dat gcc-
3.4.5-glibc-2 .3.6-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.5.dat` sh all.sh --notest
eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.5-tls.dat` sh all.sh --notest //I choose this line!!!
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.6.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.6-tls.dat` sh all.sh --notest #eval `cat arm9tdmi.dat gcc
-4.1.0-glibc-2.3.2.dat` sh all.sh --notest
#eval `cat arm9tdmi.dat gcc-4.1.0-glibc-2.3.2-tls.dat` sh all.sh --notest

echo Done. //The above means you want to select the version number of the toolchain! "#" is a comment function! We can select a line!

I changed RESULT_TOP=/opt/crosstool to RESULT_TOP=$HOME/toolchains, and created two directories, downloads and toolchains, under the HOME directory, to store the source code package and the toolchain to be generated respectively.

Open the arm9tdmi.dat file in the crosstool-0.43 directory, the content is as follows:

KERNELCONFIG=`pwd`/arm.config
TARGET=arm-9tdmi-linux-gnu
GCC_EXTRA_CONFIG="--with-cpu=arm9tdmi --enable-cxx-flags=-mcpu=arm9tdmi"
TARGET_CFLAGS="-O"

This file is generally used to set some variables, generally do not need to be changed, just use the default!

Open the gcc-4.0.2-glibc-2.3.5-tls.dat file in the crosstool-0.43 directory, the content is as follows:

BINUTILS_DIR=binutils-2.16.1
GCC_DIR=gcc-4.0.2
GLIBC_DIR=glibc-2.3.5
LINUX_DIR=linux-2.6.15.4
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.5
GLIBC_EXTRA_CONFIG="$GLIBC_EXTRA_CONFIG --with-tls --with-__thread --enable-kernel=2.4.18"

Then you can go to the Internet to download the several source packages marked in red above, pay attention to the corresponding version numbers, and store them in the downloads directory after downloading. Note that there is no need to decompress! ! You can even remove the line LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0 (of course you will need to download this package)! You can download these packages from the mirror sites in China:

http://mirrors.shlug.org/ http://www.cn.kernel.org/pub/linux

http://www.cn.kernel.org/pub/software ftp://ftp.cn.kernel.org/pub/linux

ftp://ftp.cn.kernel.org/pub/software

NOW,IT'S OK!

2. Enter the crosstool-0.43 directory and enter ./demo-arm9tdmi.sh. After a few hours of compilation, you can see the toolchain, header files, library files, etc. you want in your toolchains directory! You can add the directory where the toolchain is located to the environment variable PATH to use the toolchain!

Note: There are patches for each toolchain in the PATCH directory under the crosstool-0.43 directory. If there are errors during compilation, you can apply patches to the decompressed source files in the build directory under the crosstool-0.43 directory (I compiled successfully without patches). In addition, if you don't want to waste time decompressing files every time you compile, you can add --nounpack at the end of eval `cat arm9tdmi.dat gcc-4.0.2-glibc-2.3.5-tls.dat` sh all.sh --notest to indicate that you don't want to decompress files (of course, the premise is that you have already decompressed the source code package to the corresponding directory /build/gcc-4.0.2-glibc-2.3.5- tls/arm-9tdmi-linux-gnu, and you can also apply patches to it at this time).
Keywords:ARM Reference address:Guide to making ARM Linux cross-compilation toolchain

Previous article:Building an ARM Linux cross-compilation toolchain
Next article:Establishing arm gcc cross-compilation tool chain

Recommended ReadingLatest update time:2024-11-22 20:10

When will the chip shortage end? ARM CEO gives the answer
ARM CEO Simon Segars said the global chip shortage is very complex to resolve and expects current supply chain disruptions to continue until 2022. According to the executive, the semiconductor industry is now spending $2 billion per week to increase production capacity and expects this investment to result in a 50%
[Semiconductor design/manufacturing]
Porting e2fsprogs to arm platform
Porting e2fsprogs to arm platform That is general cross-compilation. Since e2fsprogs usually uses dynamic libraries, static linking is used here for convenience. In this way, when copying to the arm platform, you don't need to worry about the dynamic library. The specific operation process is as follows: tar -
[Microcontroller]
ARM interrupt processing and state machine nesting implementation
1.ARM7 provides two levels of interrupts, FIQ (Fast Interrupt Request) general interrupt and low-speed response interrupt IRQ.   Once all interrupt requests are generated, the interrupt response will go through three steps   a. Input stage This logic can be implemented according to the interrupt source, requiring 0-2
[Microcontroller]
Design of Linux Software Development Kit Based on FIE8100 SoC Platform
introduction Faraday Technology's FIE8100 SoC platform is a low-power, portable SoC platform for developing video-related applications. It can also be used for SoC design verification based on the FA526 CPU. Based on the Linux software development kit of FA526, developers can install and implement the Linux-2.4.19 s
[Microcontroller]
Design of Linux Software Development Kit Based on FIE8100 SoC Platform
What is the meaning of interrupt? How to set up interrupts for ARM processors?
What is an interrupt? In the processor, the so-called interrupt is a process, that is, when the CPU is executing a program, it encounters an external/internal emergency event that needs to be handled, temporarily suspends the current program execution and serves the event. After the service is completed, it returns to
[Microcontroller]
What is the meaning of interrupt? How to set up interrupts for ARM processors?
Application of ARM7 Embedded System in Vehicle Dispatching System Design
    1. Overall design of vehicle dispatching system:     The whole system consists of four parts: (1) communication master station; (2) vehicle-mounted slave station; (3) communication link; and (4) system monitoring part. The following is a brief introduction to the functions of each part.     (1) Communication maste
[Microcontroller]
Application of ARM7 Embedded System in Vehicle Dispatching System Design
ARM Embedded Software Programming Experience
ARM series processors are RISC (Reduced InSTructiON Set Computing) processors. Many ARM-based efficient code programming strategies are derived from RISC processors. Like many RISC processors, memory access of ARM series processors also requires data alignment, that is, when accessing "word" data, four-byte alignmen
[Microcontroller]
ARM Embedded Software Programming Experience
Microsoft will strengthen script execution controls on Linux to improve security
According to news on May 14, at the Linux Security Summit held in Vancouver this week, Lennart Poettering, the systemd developer hired by Microsoft, and other Microsoft engineers gave a speech and said that Microsoft is working hard to improve the security of Linux. In his speech, Microsoft developer Mickaël Salaün
[Embedded]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号