1. Installation environment
libstdc (standard C++ library, including shared static libraries)
libtool and make (for basic builds)
GNU MP (for efficient and precise math)
gperf (a perfect hash function generator)
bison (C parser)
flex ( lexical pattern recognition engine)
ncurses (terminal graphics library)
sed (stream editor)
subversion (client tool for accessing SVN code repositories)
texinfo (a documentation generation and parsing tool)
sudo apt-get install -y byacc flex texinfo help2man gawk libtool libtool-bin libncurses5-dev
2. Download the installation package
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.25.0.tar.bz2
3. Unzip
tar xvf crosstool-ng-1.25.0.tar.bz2
4. Configuration
cd rosstool-ng-1.25.0
./configure --prefix=/opt/crosstool-ng
5. Compile
make -j8
6. Installation
sudo make install
7. Configuration
ct-ng aarch64-rpi4-linux-gnu
ct-ng menuconfig
All defaults are fine.
For details, please refer to the bottom link
8. Compile
ct-ng build
It takes 3 hours to do a good job of cooling. . .