I see there are libraries installed, as i see files like '/usr/lib64/clang/3.7.1/lib/linux/libclang_rt.ubsan_standalone-x86_64.a', but when i try to use clang with, say, '-fsanitize=undefined', i get this: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lubsan Do i need to give it some special nudge to be able to find those libraries in gentoo?
Please paste the verbose compiler output ('clang -v ...'). Are the libraries accessible via /usr/lib/clang? (without -64 suffix)
Okay, in fact the problem is the static analyzer doing strange things with make: ‰ CFLAGS='-fsanitize=undefined' LDFLAGS='-fsanitize=undefined' scan-build make scan-build: Using '/usr/bin/x86_64-pc-linux-gnu-clang-3.7' for static analysis /usr/bin/ccc-analyzer -fsanitize=undefined -o catdoc catdoc.o reader.o writer.o analyze.o rtfread.o charsets.o substmap.o fileutil.o confutil.o numutils.o ole.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lubsan ... ‰ CFLAGS='-fsanitize=undefined' LDFLAGS='-fsanitize=undefined' CC=clang scan-build make scan-build: Using '/usr/bin/x86_64-pc-linux-gnu-clang-3.7' for static analysis /usr/bin/ccc-analyzer -fsanitize=undefined -o catdoc catdoc.o reader.o writer.o analyze.o rtfread.o charsets.o substmap.o fileutil.o confutil.o numutils.o ole.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lubsan ... ‰ CFLAGS='-fsanitize=undefined' LDFLAGS='-fsanitize=undefined' CC=clang make clang -fsanitize=undefined -o catdoc catdoc.o reader.o writer.o analyze.o rtfread.o charsets.o substmap.o fileutil.o confutil.o numutils.o ole.o ...[ok]... It just calls gcc when run via scan-build, disregarding the environment. How do i rename the bug? (:
FWICS it's intentional. You can either set CCC_CC and CCC_CXX, or use --use-cc, --use-c++ arguments to scan-build.