ubuntuclangllvmklee

C compiler cannot create executables during build of Coreutils with LLVM


I am looking for some assistance in figuring out the solution to an error that pops up during the configure command of Coreutils with llvm.

I use the command:

CC=wllvm ../configure --disable-nls CFLAGS="-g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__"

and receive the errors:

checking whether the compiler works...no
configure: error: in '/home/abhinath/coreutils/obj-llvm
configure: error: c compiler cannot create executables

I have run the command export LLVM_COMPILER=clang beforehand

I have installed and set up clang-6.0 and clang++-6.0 on my Ubuntu OS using the commands

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 1000
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 1000
sudo update-alternatives --config clang
sudo update-alternatives --config clang++

The config.log file with errors generated can be viewed here, which also shows wllvm: command not found:

https://drive.google.com/open?id=1ExbLhT2tWRyGSAb67mAgu6D9y3AknZ2v


Solution

  • Typically, nothing in /usr/local is included in the system directories.

    And a non-standard location like usr/local/lib/python2.7/site-packages/some-directory even less so.

    You need to find the exact location (as in full and absolute path) of the wllvm program and either use that full path or add its directory to the PATH environment variable.