#StackBounty: #clang #cross-compiling #gnu-coreutils How to cross-compile Coreutils or other GNU projects with clang/LLVM?

Bounty: 400

I have a tough need to compile Coreutils with llvm for other arch: arm/aarch64/mips/mips32/ppc/ppc32…

Since I install all the gcc-cross tools like mips-linux-gnu, powerpc64-linux-gnu and if I have a simple C program like that test.c

#include<stdio.h>
int main(){
    printf("hello!");
    return 0;
}

I can compile it to the arch, i.e.

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

I try to the same way for compile Coreutils that try to set

export CC=clang
export CXX=clang++
CFLAGS = "--target=mips64-linux-gnuabi64"
./configure --host=mips64-linux-gnuabi64

Howerver, every time got errors in configure or make…

How should I set the configure? Can I easily compile Coreuntils with llvm for other archs?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.