【发布时间】:2020-10-05 01:37:54
【问题描述】:
我非常需要为其他架构编译带有 llvm 的 Coreutils:arm/aarch64/mips/mips32/ppc/ppc32...
因为我安装了所有 gcc-cross 工具,如 mips-linux-gnu、powerpc64-linux-gnu,并且如果我有一个像 test.c 这样的简单 C 程序
#include<stdio.h>
int main(){
printf("hello!");
return 0;
}
我可以把它编译成拱形,即
clang --target=mips64-linux-gnuabi64 test.c -o test-mips64
➜ tests file test-mips64
test-mips64: ELF 64-bit MSB executable, MIPS, MIPS64 rel2 version 1 (SYSV), dynamically linked, interpreter /lib64/ld.so.1, BuildID[sha1]=7b33d55a0d08e6cd18d966341590dc351e346a78, for GNU/Linux 3.2.0, not stripped
我尝试以相同的方式编译Coreutils,尝试设置
export CC=clang
export CXX=clang++
CFLAGS = "--target=mips64-linux-gnuabi64"
./configure --host=mips64-linux-gnuabi64
但是,每次配置或制作时都会出错...
我应该如何设置配置?我可以为其他架构轻松编译带有 llvm 的 Coreuntils 吗?
【问题讨论】:
-
在交叉编译方面,您需要做很多事情。我们需要更多信息来帮助您。至少描述您尝试过的内容以及遇到的错误。
-
还有你在使用哪个系统?
标签: clang cross-compiling gnu-coreutils