[llvm-bugs] [Bug 40797] New: Undefined reference with -fsanitize-coverage=trace-pc
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Feb 20 22:53:43 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40797
Bug ID: 40797
Summary: Undefined reference with -fsanitize-coverage=trace-pc
Product: clang
Version: 7.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: drmint80 at gmail.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
I faced issue when compile with -fsanitize-coverage=trace-pc.
test for this:
cov.cc
#include <stdio.h>
__attribute__((noinline))
void foo() { printf("foo\n"); }
int main(int argc, char **argv) {
if (argc == 2)
foo();
printf("main");
}
vmx at vmx-virtual-machine:~/Documents/clang$ clang++-7 -g cov.cc
-fsanitize=address -fsanitize-coverage=trace-pc -v
clang version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
"/usr/lib/llvm-7/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name cov.cc -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -v -resource-dir
/usr/lib/llvm-7/lib/clang/7.0.0 -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward
-internal-isystem /usr/include/clang/7.0.0/include/ -internal-isystem
/usr/local/include -internal-isystem /usr/lib/llvm-7/lib/clang/7.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /home/vmx/Documents/clang
-ferror-limit 19 -fmessage-length 210 -fsanitize-coverage-type=3
-fsanitize-coverage-trace-pc -fsanitize=address
-fsanitize-blacklist=/usr/lib/llvm-7/lib/clang/7.0.0/share/asan_blacklist.txt
-fsanitize-address-use-after-scope -fno-assume-sane-operator-new
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cov-a15c76.o -x c++ cov.cc -faddrsig
clang -cc1 version 7.0.0 based upon LLVM 7.0.0 default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/include"
ignoring duplicate directory
"/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0"
ignoring duplicate directory "/usr/include/clang/7.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward
/usr/include/clang/7.0.0/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
"/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o a.out
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crt1.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crti.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/crtbegin.o
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../..
-L/usr/lib/llvm-7/bin/../lib -L/lib -L/usr/lib --whole-archive
/usr/lib/llvm-7/lib/clang/7.0.0/lib/linux/libclang_rt.asan-x86_64.a
--no-whole-archive
--dynamic-list=/usr/lib/llvm-7/lib/clang/7.0.0/lib/linux/libclang_rt.asan-x86_64.a.syms
--whole-archive
/usr/lib/llvm-7/lib/clang/7.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a
--no-whole-archive
--dynamic-list=/usr/lib/llvm-7/lib/clang/7.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a.syms
/tmp/cov-a15c76.o -lstdc++ -lm --no-as-needed -lpthread -lrt -lm -ldl -lgcc_s
-lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/crtend.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crtn.o
/tmp/cov-a15c76.o: In function `foo()':
/home/vmx/Documents/clang/cov.cc:5: undefined reference to
`__sanitizer_cov_trace_pc'
/tmp/cov-a15c76.o: In function `main':
/home/vmx/Documents/clang/cov.cc:7: undefined reference to
`__sanitizer_cov_trace_pc'
/home/vmx/Documents/clang/cov.cc:8: undefined reference to
`__sanitizer_cov_trace_pc'
/home/vmx/Documents/clang/cov.cc:9: undefined reference to
`__sanitizer_cov_trace_pc'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190221/75c1a794/attachment-0001.html>
More information about the llvm-bugs
mailing list