Today, learn how to build the Loongson kernel compilation environment on the x86 platform.
First install the virtual machine and download the linux system image.
Then download the compiler in the Loongson open source community
Select compilation tool
Select cross compiler
Download gcc4.4.7 64 bit
Unzip the compiler to the /opt directory
tar -xzf gcc-4.4.7-7215-o32-loongson.tar.gz -C /opt
Set the environment variable
export PATH=/ opt/gcc-4.4.7-7215-xxx-loongson/usr/bin/:$PATH
export LD_LIBRARY_PATH=/opt/gcc-4.4.7-7215-xxx-loongson/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib:$LD_LIBRARY_PATH
Use the export command to check and find that the environment variables are set. We can compile the kernel.