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).
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
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Another technical solution for power-type plug-in hybrid: A brief discussion on Volvo T8 plug-in hybrid technology
- Last day, make an appointment and get a gift: Design and test solution for vehicle-mounted radar
- Network Control of ROS Melodic
- Can someone please help me derive this formula?
- Everyone come and join me, I made a photovoltaic inverter control (MPPT) all-in-one machine
- Let’s take a look at how this overvoltage protection circuit can be optimized?
- ST releases the world's first LoRa SoC microcontroller STM32WL
- Today at 10:00 AM, live broadcast with prizes: TI's new generation of integrated PA Zigbee 3.0 and multi-protocol solutions
- PIR sensor module manufacturers
- Inverter and Motor Control
- Recently, a wave of netizens have had their accounts hacked