Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579472 - sys-devel/llvm-3.7.1-r1: scan-build drops $CC
Summary: sys-devel/llvm-3.7.1-r1: scan-build drops $CC
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-09 23:38 UTC by Sergey 'L29Ah' Alirzaev
Modified: 2016-04-13 13:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 'L29Ah' Alirzaev 2016-04-09 23:38:17 UTC
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?
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-04-13 11:51:03 UTC
Please paste the verbose compiler output ('clang -v ...').

Are the libraries accessible via /usr/lib/clang? (without -64 suffix)
Comment 2 Sergey 'L29Ah' Alirzaev 2016-04-13 12:10:09 UTC
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? (:
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-04-13 13:04:22 UTC
FWICS it's intentional. You can either set CCC_CC and CCC_CXX, or use --use-cc, --use-c++ arguments to scan-build.