[LLVMdev] libclang_rt.asan-x86_64.a: No such file or directory

Dave Mitchell davem at iabyn.com
Tue Apr 21 05:35:31 PDT 2015


I just tried building the latest clang following the instructions in
http://clang.llvm.org/get_started.html, and got this error when trying to
compile at test program:

/usr/bin/ld: cannot find /home/davem/clang-235334/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory

This thread:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-April/084175.html

indicates that the solution is to start with a clean build, but that's
what I just tried, and it still failed.

Here's my install log:

$ rm -rf ~/tmp/clang
$ mkdir ~/tmp/clang; cd ~/tmp/clang
$ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
$ cd llvm/tools
$ svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
$ cd ../..
$ export clang_version=235086
$ cd llvm/tools/clang/tools
$ svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
$ cd ../../../..
$ cd llvm/projects
$ svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
$ cd ../..
$ mkdir $HOME/clang-$clang_version
$ mkdir build; cd build
$ ../llvm/configure --prefix=$HOME/clang-$clang_version --enable-optimized --disable-assertions
$ make && make install
$ cd ~/tmp; mv clang/ clang.hide # make sure build dir isn't needed

$ bash
$ PATH=/home/davem/clang-$clang_version/bin:$PATH
$ echo $PATH
/home/davem/clang-235334/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/davem/bin:/home/davem/bin-perl
$ which clang
~/clang-235334/bin/clang
$ cat d.c
int main(int argc, char**argv)
{
    char *p = (char*)0x1234;
    *p = 0;
}

$ clang -fsanitize=address -o d d.c
/usr/bin/ld: cannot find /home/davem/clang-235334/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This recipe has worked for me in the past.


-- 
"Do not dabble in paradox, Edward, it puts you in danger of fortuitous wit."
    -- Lady Croom, "Arcadia"



More information about the llvm-dev mailing list