【发布时间】:2018-08-21 18:53:25
【问题描述】:
我是 trying to follow this blog,但在 Windows 上使用最新的 Rust。在我看来,做这种事情的正确方法在 Rust 中经常发生变化,所以我希望有一个最新的 Windows 适配。
到目前为止我所做的尝试:
我安装了gcc-arm-embedded。
我在手动交叉编译 libcore 时获得了部分成功,但后来我转而使用推荐的 xargo,其功能(我读过)最终将包含在 Cargo 中。虽然我不太了解其中的任何内容,但我希望能够进入我可以编写/运行代码的部分,然后也许我可以更好地理解编译。
使用japaric's awesome help,我能够让“aarch64”目标构建工作以生成 .o 文件 (as of this particular commit)。
这部分似乎验证了:
$ file target/aarch64-raspi3-none-elf/release/deps/rust_rasp-ed0c2377e0a7df81.o
target/aarch64-raspi3-none-elf/release/deps/rust_rasp-ed0c2377e0a7df81.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), not stripped
当我尝试使用 GNU Arm Embedded Toolchain 链接器时,我得到:
$ arm-none-eabi-gcc -O0 -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -nostartfiles target/aarch64-raspi3-none-elf/release/deps/rust_rasp-ed0c2377e0a7df81.o -o kernel.elf target/aarch64-raspi3-none-elf/release/deps/rust_rasp-ed0c2377e0a7df81.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
而#rust IRC 聊天室帮助告诉我 rpi3 是 aarch64,而不是 arm,所以我需要找到一个 aarch64 链接器...
【问题讨论】:
标签: windows rust llvm cross-compiling raspberry-pi3