本篇內(nèi)容主要講解“如何在Windows中交叉編譯arm”,感興趣的朋友不妨來看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“如何在Windows中交叉編譯arm”吧!
創(chuàng)新互聯(lián)是一家專注于網(wǎng)站設(shè)計(jì)制作、網(wǎng)站制作與策劃設(shè)計(jì),墨竹工卡網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:墨竹工卡等地區(qū)。墨竹工卡做網(wǎng)站價(jià)格咨詢:18982081108
1.安裝toolchain stable-x86_64-pc-windows-gnu | stable-x86_64-pc-windows-msvc
命令如下:rustup toolchain install stable-x86_64-pc-windows-gnu
2.增加target rustup target add arm-unknown-linux-musleabi
(arm32位,標(biāo)準(zhǔn)c庫,對(duì)應(yīng)的編譯器 arm-none-eabi-gcc)
rustup target add arm-unknown-linux-gnueabihf
(arm32位,需要glibc庫,對(duì)應(yīng)的編譯器 arm-none-linux-gnueabihf-gcc)
rustup target add aarch74-unknown-linux-gnu
(arm64位,需要glibc庫,對(duì)應(yīng)的編譯器 aarch74-none-linux-gnu-gcc)
rustup target add aarch74-unknown-linux-musl
(arm64位,標(biāo)準(zhǔn)c庫,對(duì)應(yīng)的編譯器 aarch74-none-elf-gcc)
以上編譯器下載地址:
GNU Toolchain | GNU-A Downloads – Arm Developer
下載完解壓即可
3.配置cargo config文件
C:\Users\xxx\.cargo\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.例如編譯arm-unknown-linux-musleabi
命令如下: cargo build --target arm-unknown-linux-musleabi --verbose
到此,相信大家對(duì)“如何在Windows中交叉編譯arm”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!