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

I just tried building the latest clang following the instructions in, 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:

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 llvm
$ cd llvm/tools
$ svn co clang
$ cd ../..
$ export clang_version=235086
$ cd llvm/tools/clang/tools
$ svn co extra
$ cd ../../../..
$ cd llvm/projects
$ svn co 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
$ which 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.


Oh, I see. We’ve dropped support for ASan in autotools build a while ago. The recommended build process now involves CMake:

I will update the www page shortly.

That did the trick, thanks.

I have architecture in which only legal type supported is i64.

So inside getCopyToParts() function. when ValueVT=f32 and PartVT==i64
I added code to handle this condition inside
if(NumParts * PartBits > ValueVT.getSizeInBits()) block
as follows:

if(ValueVT == EVT(MVT::f32) && PartVT == MVT::i64){
    SDValue IntMVal = DAG.getNode(ISD::FP_EXTEND, DL, MVT::f64, Val);
    Val = DAG.getNode(ISD::BITCAST, DL, PartVT, IntMVal);

And inside getCopyFromParts() function at the end I added:
if(ValueVT == EVT(MVT::f32)) {
    SDValue IntMVal = DAG.getNode(ISD::TRUNCATE, DL, EVT(MVT::i32), Val);
return DAG.getNode(ISD::BITCAST, DL, ValueVT, IntMVal);

After giving -debug to llc, in Optimized lowered selection DAG phase I get

                  0x21103e0: i64,ch = CopyFromReg 0x20d86e0, 0x210e6b0

                0x210e7b0: i32 = truncate 0x21103e0 [ORD=4]

              0x2110ce0: f32 = bitcast 0x210e7b0 [ORD=4]

              0x210ffd0: f32 = ConstantFP<1.000000e+00>

            0x210e5b0: f32 = fadd 0x2110ce0, 0x210ffd0 [ORD=4]

          0x210f7d0: f64 = fp_extend 0x210e5b0 [ORD=4]

        0x210f3d0: i64 = bitcast 0x210f7d0 [ORD=4]

      0x210deb0: ch = CopyToReg 0x20d86e0, 0x21106e0, 0x210f3d0 [ORD=4]

after this llc fails in Legalizer:

"Operand not processed?
0x210deb0: ch = CopyToReg 0x20d86e0, 0x21106e0, 0x2125d30 [ORD=4] [ID=1]

with third operand of CopyToReg some garbage value.
What am I doing wrong ?