- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- Datacenter
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you provide a reproducer?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page