How to build coreutils with LLVM 3.4

I am trying to build GNU Coreutils 8.23 ​​using the LLVM 3.4 toolchain. One very important aspect is that I also need LLVM bytecode for all cells. Therefore, I need to include -emit-llvmin CFLAGS. So I removed $ (CFLAGS) from the LINK variable of the makefile coreutils file. Subsequently, I run the following command:

make CC=/home/user/llvm-3.4.2/build/Release+Asserts/bin/clang 
CCLD=/home/user/llvm-3.4.2/build/Release+Asserts/bin/llvm-link 
IGNORE_UNUSED_LIBRARIES_CFLAGS= CFLAGS="-emit-llvm -S" 
VERBOSE=1 AM_CFLAGS= AM_LDFLAGS= 
AR=/home/user/llvm-3.4.2/build/Release+Asserts/bin/llvm-ar 
RANLIB=/home/user/llvm-3.4.2/build/Release+Asserts/bin/llvm-ranlib

and I get the following error:

/home/user/llvm-3.4.2/build/Release+Asserts/bin/llvm-link: src/libver.a:1:2:    error: expected integer
!<arch>
 ^
/home/user/llvm-3.4.2/build/Release+Asserts/bin/llvm-link: error loading file 'src/libver.a'

Any ideas on how to make this work?

+4
source share
2 answers

Try it.

export CC="/home/user/llvm-3.4.2/build/Release+Asserts/bin/clang"
export CXX="/home/user/llvm-3.4.2/build/Release+Asserts/bin/clang++" 

Make sure your compiler toolchain is present at this point.

coreutils ./configure ( ./bootstrap, ). ./configure clang Makefile .

a make make install .

+1

Lib '.a' llvm-link. , , Makefile, lib,

AR = llvm-link, ar option = -o(i.e. change ar rv to llvm-link -o), 

runlib ( ranlib llvm-link).

.a bc, .a ' llvm-link,

0

All Articles