LLVM code coverage build problem - LLVM_BUILD_INSTRUMENTED_COVERAGE

Hi ,

I am trying to build LLVM instrumented compiler for code coverage .

When I attempted to build the compiler using “-DLLVM_BUILD_INSTRUMENTED_COVERAGE=ON”, I end up in the below compiler flag problem.

Please let me know, if you have any info related to this problem or if I have missed anything

cmake -DCMAKE_C_COMPILER=/usr/64bit/bin/gcc \

-DCMAKE_CXX_COMPILER=/usr/64bit /bin/g++ \

-DCMAKE_BUILD_TYPE=Release \

-DLLVM_TARGETS_TO_BUILD=“X86” \

-DLLVM_BUILD_INSTRUMENTED_COVERAGE=ON

file /usr/64bit/bin/gcc

/usr//usr/64bit/bin/bin/gcc: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped

/usr/64bit/bin/gcc -v

gcc version 4.9.4 (GCC)

Problem like below

[ 0%] Building CXX object utils/PerfectShuffle/CMakeFiles/llvm-PerfectShuffle.dir/PerfectShuffle.cpp.o

gcc: error: unrecognized command line option ?-fprofile-instr-generate=%4m.profraw?

gcc: error: unrecognized command line option ?-fcoverage-mapping?

make[2]: *** [utils/count/CMakeFiles/count.dir/build.make:63: utils/count/CMakeFiles/count.dir/count.c.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:5589: utils/count/CMakeFiles/count.dir/all] Error 2

Thanks,

Ravi

gcc doesn’t support -fprofile-instr-generate; if you want to use it, you have to compile LLVM with clang. (See .) If you want to use gcov/lcov, you can use “CXXFLAGS=–coverage” or something like that. -Eli