Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
827 Discussions

Code coverage compiler option (--coverage) throws errors for ICX compiler version2022.0.2

ShivaPrasad
Beginner
564 Views

I wanted to use the code coverage for my CPP code, for this I am using the compiler option (--coverage), I am facing linking issues as mentioned below.

 

/opt/intel/oneapi/compiler/2022.0.2/linux/lib/clang/14.0.0/lib/linux/libclang_rt.profile-x86_64.a(GCDAProfiling.c.o): in function `llvm_gcda_start_file':
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x73): relocation truncated to fit: R_X86_64_PC32 against `.bss.filename'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0xa0): relocation truncated to fit: R_X86_64_PC32 against `.bss.filename'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0xca): relocation truncated to fit: R_X86_64_PC32 against `.bss.filename'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0xd6): relocation truncated to fit: R_X86_64_PC32 against `.bss.filename'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0xf9): relocation truncated to fit: R_X86_64_PC32 against `.bss.filename'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x133): relocation truncated to fit: R_X86_64_PC32 against `.bss.output_file'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x139): relocation truncated to fit: R_X86_64_PC32 against `.bss.new_file'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x141): relocation truncated to fit: R_X86_64_PC32 against `.bss.write_buffer'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x14c): relocation truncated to fit: R_X86_64_PC32 against `.bss.cur_buffer_size'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x157): relocation truncated to fit: R_X86_64_PC32 against `.bss.cur_pos'
GCDAProfiling.c:(.text.llvm_gcda_start_file+0x171): additional relocation overflows omitted from the output
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:379: a.out] Error 1

 

I have used compiler options CFLAGS "-static-intel -mcmodel=large" as well but not able to solve this.

In the compiler documentation I see there are, these options but didn't find any docs to explain how to use them.

-fcoverage-compilation-dir=<value>
The compilation directory to embed in the coverage mapping.
-fcoverage-mapping Generate coverage mapping to enable code coverage analysis
-fcoverage-prefix-map=<value>
remap file source paths in coverage mapping

 

If anyone has idea on how to use the above options or to the solve the above linking error, Please suggest.

 

I am using ubunutu 24.04LTS linux machine and not using VS, I am using cscope and Vim for code navigation

 

0 Kudos
1 Reply
Viet_H_Intel
Moderator
519 Views

Can you provide a reproducer? 

 

0 Kudos
Reply