gcc.exe 构建 cloudflare-zlib 时失败-sys.rs
gcc.exe fail when building cloudflare-zlib-sys.rs
我正在尝试为 Amethyst.rs
游戏引擎安装 sheep_cli
。
我安装了 x86_64-8.1.0-posix-seh-rt_v6-rev0
MinGW。也许目标是错误的?
error: failed to run custom build command for `cloudflare-zlib-sys v0.2.0`
Caused by:
process didn't exit successfully: `C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV\release\build\cloudflare-zlib-sys-eda63c9230465ae7\build-script-build` (exit code: 1)
--- stdout
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
cargo:include=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor" "-mpclmul" "-msse4.2" "-msse4.2" "-DHAVE_OFF64_T=1" "-D_LARGEFILE64_SOURCE=
1" "-DHAVE_UNISTD_H=1" "-DHAS_PCLMUL" "-DHAS_SSE42" "-DHAVE_HIDDEN=1" "-o" "C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV\release\build\cloudflare-zlib-sys-399f3ab9f80722f4\out\crc32-pclmul_asm.o" "-c" "C:\Users\user\.cargo\registry\src\gith
ub.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S"
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S: Assembler messages:
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:125: Error: unknown pseudo-op: `.hidden'
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:125: Warning: .type pseudo-op used outside of .def/.endef: ignored.
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:125: Error: junk at end of line, first unrecognized character is `c'
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:266: Warning: .size pseudo-op used outside of .def/.endef: ignored.
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:266: Error: junk at end of line, first unrecognized character is `c'
exit code: 1
--- stderr
error occurred: Command "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor" "-mpclmul" "-msse4.2" "-msse4.2" "-DHAVE_OFF64_T=1" "-D_LARG
EFILE64_SOURCE=1" "-DHAVE_UNISTD_H=1" "-DHAS_PCLMUL" "-DHAS_SSE42" "-DHAVE_HIDDEN=1" "-o" "C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV\release\build\cloudflare-zlib-sys-399f3ab9f80722f4\out\crc32-pclmul_asm.o" "-c" "C:\Users\user\.cargo\regi
stry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S" with args "gcc.exe" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sheep_cli v0.3.0`, intermediate artifacts can be found at `C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV`
Caused by:
build failed
那个箱子有你在用 Rust MinGW 工具链构建时显示的构建问题,但如果你使用 MSVC 工具链它编译得很好,这需要 Visual Studio C++ Build Tools(或最新版本的 Visual Studio).
要安装最新稳定的 MSVC 工具链,请使用以下命令:
rustup toolchain install stable-msvc
然后,将其设置为所有 Rust 项目的默认工具链:
rustup default stable-msvc
有关 Rust 工具链的 MSVC 和 MinGW 风格的更多信息,您可以查看 the official documentation。
更新:cloudflare-zlib-sys
crate 的 0.3.0 版修复了 Windows MinGW 构建,因此如果您使用的是该 crate 的最新版本,则不再需要此解决方法。
我正在尝试为 Amethyst.rs
游戏引擎安装 sheep_cli
。
我安装了 x86_64-8.1.0-posix-seh-rt_v6-rev0
MinGW。也许目标是错误的?
error: failed to run custom build command for `cloudflare-zlib-sys v0.2.0`
Caused by:
process didn't exit successfully: `C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV\release\build\cloudflare-zlib-sys-eda63c9230465ae7\build-script-build` (exit code: 1)
--- stdout
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
cargo:include=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
CC_x86_64-pc-windows-gnu = None
CC_x86_64_pc_windows_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor" "-mpclmul" "-msse4.2" "-msse4.2" "-DHAVE_OFF64_T=1" "-D_LARGEFILE64_SOURCE=
1" "-DHAVE_UNISTD_H=1" "-DHAS_PCLMUL" "-DHAS_SSE42" "-DHAVE_HIDDEN=1" "-o" "C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV\release\build\cloudflare-zlib-sys-399f3ab9f80722f4\out\crc32-pclmul_asm.o" "-c" "C:\Users\user\.cargo\registry\src\gith
ub.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S"
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S: Assembler messages:
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:125: Error: unknown pseudo-op: `.hidden'
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:125: Warning: .type pseudo-op used outside of .def/.endef: ignored.
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:125: Error: junk at end of line, first unrecognized character is `c'
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:266: Warning: .size pseudo-op used outside of .def/.endef: ignored.
cargo:warning=C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S:266: Error: junk at end of line, first unrecognized character is `c'
exit code: 1
--- stderr
error occurred: Command "gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor" "-mpclmul" "-msse4.2" "-msse4.2" "-DHAVE_OFF64_T=1" "-D_LARG
EFILE64_SOURCE=1" "-DHAVE_UNISTD_H=1" "-DHAS_PCLMUL" "-DHAS_SSE42" "-DHAVE_HIDDEN=1" "-o" "C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV\release\build\cloudflare-zlib-sys-399f3ab9f80722f4\out\crc32-pclmul_asm.o" "-c" "C:\Users\user\.cargo\regi
stry\src\github.com-1ecc6299db9ec823\cloudflare-zlib-sys-0.2.0\vendor\contrib/amd64/crc32-pclmul_asm.S" with args "gcc.exe" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sheep_cli v0.3.0`, intermediate artifacts can be found at `C:\Users\user\AppData\Local\Temp\cargo-installMN5vHV`
Caused by:
build failed
那个箱子有你在用 Rust MinGW 工具链构建时显示的构建问题,但如果你使用 MSVC 工具链它编译得很好,这需要 Visual Studio C++ Build Tools(或最新版本的 Visual Studio).
要安装最新稳定的 MSVC 工具链,请使用以下命令:
rustup toolchain install stable-msvc
然后,将其设置为所有 Rust 项目的默认工具链:
rustup default stable-msvc
有关 Rust 工具链的 MSVC 和 MinGW 风格的更多信息,您可以查看 the official documentation。
更新:cloudflare-zlib-sys
crate 的 0.3.0 版修复了 Windows MinGW 构建,因此如果您使用的是该 crate 的最新版本,则不再需要此解决方法。