[LLVMdev] Building LLVM with asan

Alexander Potapenko glider at google.com
Thu Nov 21 02:24:33 PST 2013


On Thu, Nov 21, 2013 at 6:18 AM, Keno Fischer <kfischer at csail.mit.edu> wrote:
> Hello everybody,
>
> after moving from OS X to Linux build llvm with asan enabled
Sorry, I failed to parse this. You're compiling Clang on Linux, and
OSX is unrelated, right?
> (I also updated
> to trunk, but not sure if that's related). However, it's totally possible
> that I missed a step that I took back when I set this up for me, so I might
> be doing something very stupid. Anyway, I'm configuring LLVM with
>
> ../configure --prefix=/home/kfischer/julia/usr --build=x86_64-pc-linux-gnu
> FC=gfortran
> CC="/home/kfischer/julia/deps/llvm-svn/build_Release+Asserts/Release+Asserts/bin/clang
> -fsanitize=address"
> CXX="/home/kfischer/julia/deps/llvm-svn/build_Release+Asserts/Release+Asserts/bin/clang++"
> -fsanitize=address --disable-profiling --enable-shared --enable-static
> --enable-targets=host --disable-bindings --disable-docs --enable-assertions
> --enable-optimized --disable-threads
So you're building Clang with -fsanitize=address. Note: you won't be
able to build libsanitizer this way.

> in a different directory (build_Release+Asserts+Sanitize). As you can see
> I'm bootstrapping this through a different copy of clang I just built.
> However, now I'm getting tons of
> undefined reference to `__asan_report_store8'
> even though the command the failing command being invoked is
>
> /home/kfischer/julia/deps/llvm-svn/build_Release+Asserts/Release+Asserts/bin/clang++
> -fsanitize=address   -O3 -Wl,-R -Wl,'$ORIGIN' -rdynamic
> -L/home/kfischer/julia/deps/llvm-svn/build_Release+Asserts+Sanitize/Release+Asserts/lib
> -L/home/kfischer/julia/deps/llvm-svn/build_Release+Asserts+Sanitize/Release+Asserts/lib
> -shared -o
> /home/kfischer/julia/deps/llvm-svn/build_Release+Asserts+Sanitize/Release+Asserts/lib/libLLVM-3.5svn.so
> -Wl,--whole-archive -lLLVMAnalysis -lLLVMAsmParser -lLLVMAsmPrinter
> -lLLVMBitReader -lLLVMBitWriter -lLLVMCodeGen -lLLVMCore -lLLVMDebugInfo
> -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMInstrumentation
> -lLLVMInterpreter -lLLVMipa -lLLVMipo -lLLVMIRReader -lLLVMLinker -lLLVMLTO
> -lLLVMMC -lLLVMMCDisassembler -lLLVMMCJIT -lLLVMMCParser -lLLVMObjCARCOpts
> -lLLVMObject -lLLVMOption -lLLVMRuntimeDyld -lLLVMScalarOpts
> -lLLVMSelectionDAG -lLLVMSupport -lLLVMTarget -lLLVMTransformUtils
> -lLLVMVectorize -lLLVMX86AsmParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen
> -lLLVMX86Desc -lLLVMX86Disassembler -lLLVMX86Info -lLLVMX86Utils
> -Wl,--no-whole-archive -Wl,--soname,libLLVM-3.5svn.so -Wl,--no-undefined -lz
> -ltinfo -lm

Can you please add -v to the command line to see the ld invocation line?
You'll need to locate the ASan runtime library and check whether it's
a 32-bit one and if __asan_report_store8 is present in its symbol
table.
> Am I doing something stupid?
> Thanks,
> Keno
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
Alexander Potapenko
Software Engineer
Google Moscow



More information about the llvm-dev mailing list