How to Cross-compile arm in Windows
This article focuses on "how to cross-compile arm in Windows". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to cross-compile arm in Windows.
1. Install toolchain stable-x86_64-pc-windows-gnu | stable-x86_64-pc-windows-msvc
The command is as follows: rustup toolchain install stable-x86_64-pc-windows-gnu
two。 Add target rustup target add arm-unknown-linux-musleabi (arm32 bit, standard c library, corresponding compiler arm-none-eabi-gcc)
Rustup target add arm-unknown-linux-gnueabihf (arm32 bit, requires glibc library, corresponding compiler arm-none-linux-gnueabihf-gcc)
Rustup target add aarch74-unknown-linux-gnu (arm64 bit, requires glibc library, corresponding compiler aarch74-none-linux-gnu-gcc)
Rustup target add aarch74-unknown-linux-musl (arm64 bit, standard c library, corresponding compiler aarch74-none-elf-gcc)
Download address of the above compiler:
GNU Toolchain | GNU-A Downloads-Arm Developer
Download and decompress it.
3. Configure the cargo config file
C:\ Users\ xxx\ .editing\ config
[source.crates-io]
Replace-with = 'ustc'
[source.ustc]
Registry = "git://mirrors.ustc.edu.cn/crates.io-index"
[target.arm-unknown-linux-musleabi]
Linker = "C:\ peizhi\\ sys_gcc\\ gcc-arm-none-eabi-10-2020-q4-major-win32\\ bin\\ arm-none-eabi-gcc"
[target.arm-unknown-linux-gnueabihf]
Linker = "C:\ peizhi\\ sys_gcc\\ gcc-arm-10.2-2020.11-mingw-w64-i686-arm-none-linux-gnueabihf\\ bin\\ arm-none-linux-gnueabihf-gcc"
# = #
[target.aarch74-unknown-linux-gnu]
Linker = "C:\ peizhi\\ sys_gcc\\ gcc-arm-10.2-2020.11-mingw-w64-i686-aarch74-none-linux-gnu\\ bin\\ aarch74-none-linux-gnu-gcc"
[target.aarch74-unknown-linux-musl]
Linker = "C:\ peizhi\\ sys_gcc\\ gcc-arm-10.2-2020.11-mingw-w64-i686-aarch74-none-elf\\ bin\\ aarch74-none-elf-gcc"
4.cargo init hello
5.cd hello
6. For example, compiling arm-unknown-linux-musleabi
The command is as follows: cargo build-target arm-unknown-linux-musleabi-verbose
At this point, I believe you have a deeper understanding of "how to cross-compile arm in Windows". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!