如何为32位Little-endian PowerPC处理器编译Rustc?

时间:2019-07-03 19:26:31

标签: rust cross-compiling endianness

我正在尝试为e5500 FreeScale进程CPU(32位和低端字节序)编译rustc。我正在按照rust-cross中的说明进行操作。

我尝试了两种方法:

powerpc-unknown-linux-gnu for little-endian

我收到一个错误,因为它无法弄清楚字节序:

cargo:warning=In file included from ./compiler-rt/lib/builtins/int_types.h:21,
cargo:warning=                 from ./compiler-rt/lib/builtins/int_lib.h:75,
cargo:warning=                 from ./compiler-rt/lib/builtins/absvdi2.c:15:
cargo:warning=./compiler-rt/lib/builtins/int_endianness.h:113:2: error: #error Unable to determine endian
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "powerpc-linux-gnu-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-fomit-frame-pointer" "-DVISIBILITY_HIDDEN" "-o" "/home/ykoehler/rust-build-powerpc-fsl-linux/build/x86_64-unknown-linux-gnu/stage2-std/powerpc-unknown-linux-gnu/release/build/compiler_builtins-05a438b00e7bb558/out/./compiler-rt/lib/builtins/absvdi2.o" "-c" "./compiler-rt/lib/builtins/absvdi2.c" with args "powerpc-linux-gnu-gcc" did not execute successfully (status code exit code: 1).

', /home/ykoehler/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.28/src/lib.rs:2314:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/home/ykoehler/rust-build-powerpc-fsl-linux/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "powerpc-unknown-linux-gnu" "-j" "4" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "/home/ykoehler/rust/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
failed to run: /home/ykoehler/rust-build-powerpc-fsl-linux/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:39
make: *** [Makefile:18: all] Error 1

powerpc64le-unknown-linux-gnu(32位)

我在cflags的config.toml中设置了-m32。我收到一个错误消息,因为我的编译器不支持-m64

CC_powerpc64le-unknown-linux-gnu = Some("powerpc64le-linux-gnu-gcc")
CFLAGS_powerpc64le-unknown-linux-gnu = Some("-ffunction-sections -fdata-sections -fPIC -m64")
running: "powerpc64le-linux-gnu-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/ykoehler/rust-build-powerpc-fsl-linux/build/x86_64-unknown-linux-gnu/stage2-std/powerpc64le-unknown-linux-gnu/release/build/compiler_builtins-05a438b00e7bb558/out/./compiler-rt/lib/builtins/absvdi2.o" "-c" "./compiler-rt/lib/builtins/absvdi2.c"
cargo:warning=./compiler-rt/lib/builtins/absvdi2.c:1: error: -m64 not supported in this configuration
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "powerpc64le-linux-gnu-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/ykoehler/rust-build-powerpc-fsl-linux/build/x86_64-unknown-linux-gnu/stage2-std/powerpc64le-unknown-linux-gnu/release/build/compiler_builtins-05a438b00e7bb558/out/./compiler-rt/lib/builtins/absvdi2.o" "-c" "./compiler-rt/lib/builtins/absvdi2.c" with args "powerpc64le-linux-gnu-gcc" did not execute successfully (status code exit code: 1).

', /home/ykoehler/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.28/src/lib.rs:2314:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

0 个答案:

没有答案