小编Yan*_*ler的帖子

如何为 32 位小端 PowerPC 处理器编译 rustc?

我正在尝试为 e5500 FreeScale 进程 CPU 编译 rustc,它是 32 位和小端。我正在按照rust-cross的说明进行操作。

我尝试了两种途径:

powerpc-unknown-linux-gnu 32 位

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

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 Code Online (Sandbox Code Playgroud)

cross-compiling endianness rust

6
推荐指数
0
解决办法
819
查看次数

如何测试Makefile是否缺少依赖项?

有没有办法测试在编译具有多个作业的项目时出现的缺失依赖项(-jN,其中N> 1)?

我经常遇到包,主要是开源,只要我使用-j1,或者-jN,其中N是一个相对较低的值,如4或8,但是如果我使用更高的值,如4,有点不常见,那么构建过程正常工作,由于缺少依赖性,它开始失败.

我试图构建一个bash脚本,在给定目标的情况下,找出所有依赖项并尝试使用-j1显式构建每个依赖项,以便验证没有任何依赖项本身.它似乎适用于小型/中型软件包,但在更重要的软件包上失败,例如uClibc.

我在这里分享我的脚本,因为有些人可能会通过阅读代码更好地理解我的意思.我也希望存在一个更强大的解决方案,并且可以共享.

#!/bin/bash
TARGETS=$*
echo "TARGETS=$TARGETS"

for target in $TARGETS
do
    MAKE="make"
    RULE=`make -j1 -n -p | grep "^$target:"`
    if [ -z "$RULE" ]; then
        continue
    fi

    NEWTARGETS=${RULE#* }
    if [ -z "$NEWTARGETS" ]; then
        continue
    fi

    if [ "${NEWTARGETS}" = "${RULE}" ]; then
        # leaf target, we do not want to test.
        continue
    fi

    echo "RULE=$RULE"
#   echo "NEWTARGETS=$NEWTARGETS"
    $0 $NEWTARGETS
    if [ $? -ne 0 ]; then
        exit 1
    fi

    echo "Testing target $target"
    make …
Run Code Online (Sandbox Code Playgroud)

bash gnu makefile build-dependencies

5
推荐指数
1
解决办法
891
查看次数