gpt4 book ai didi

linux - 使用rust : error cross-compilation from Linux to Windows i686

转载 作者:太空宇宙 更新时间:2023-11-04 09:20:32 24 4
gpt4 key购买 nike

安装了哪些组件

i686-pc-windows-gnu (installed)
i686-unknown-linux-gnu (installed)
x86_64-pc-windows-gnu (installed)
x86_64-unknown-linux-gnu (default)

rust 版

rustc 1.17.0-nightly (08230775a 2017-02-24)
binary: rustc
commit-hash: 08230775a026c955873ba557e624b7f665661f37
commit-date: 2017-02-24
host: x86_64-unknown-linux-gnu
release: 1.17.0-nightly
LLVM version: 3.9

~/.cargo/配置

[target.x86_64-pc-windows-gnu]
linker = "/usr/bin/x86_64-w64-mingw32-gcc"

[target.i686-pc-windows-gnu]
linker = "/usr/bin/i686-w64-mingw32-gcc"

对于 x86_64-pc-windows-gnu 编译没问题

$ cargo rustc --target=x86_64-pc-windows-gnu --release -- -C link-args=-mwindows
Compiling ttt v0.1.0 (file:///tmp/ttt)
Finished release [optimized] target(s) in 1.21 secs

但对于 i686-pc-windows-gnu 错误(输出太长)https://gist.github.com/bc4254bdd78195e83842682d3a432688

Mingw 版本


使用内置规范。
COLLECT_GCC=i686-w64-mingw32-g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-w64-mingw32/6.3.1/lto-wrapper
目标:i686-w64-mingw32
配置为:/build/mingw-w64-gcc/src/gcc/configure --prefix=/usr --libexecdir=/usr/lib --target=i686-w64-mingw32 --enable-languages=c,lto, c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-threads=posix --enable-fully-dynamic-string --enable-libstdcxx-time=yes --with- system-zlib --enable-cloog-backend=isl --enable-lto --disable-dw2-exceptions --enable-libgomp --disable-multilib --enable-checking=release
线程模型:posix
gcc 版本 6.3.1 20170109 (GCC)

最佳答案

我遇到了同样的问题,我用 this insight 解决了来自 Arnaz87。

将这个 rustflag 添加到你的 ~/.cargo/config

[target.i686-pc-windows-gnu]
rustflags = "-C panic=abort"

关于linux - 使用rust : error cross-compilation from Linux to Windows i686,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42465380/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com