https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115628

--- Comment #2 from sadineniharish8446 at gmail dot com ---
I was trying build source code coverage for gcc but while running the tests we
are getting the following errors:
crtstuff.c:(.text.exit+0x5): undefined reference to `__gcov_exit'^M
collect2: error: ld returned 1 exit status^M
compiler exited with status 1
FAIL: g++.old-deja/g++.other/static13.C  -std=c++98 (test for excess errors)
Excess errors:
/usr/bin/ld:
/home/hsadineni/newgcc/gcc/build/gcc/testsuite/g++/../../crtbegin.o:(.data+0x80):
undefined reference to `__gcov_merge_add'
crtstuff.c:(.text.startup+0xa): undefined reference to `__gcov_init'
crtstuff.c:(.text.exit+0x5): undefined reference to `__gcov_exit'

Reproducible steps:

../configure --enable-languages=c++ --enable-coverage --disable-bootstrap
--disable-multilib  CFLAGS="-ftest-coverage -fprofile-arcs"
CXXFLAGS="-ftest-coverage -fprofile-arcs " LDFLAGS="--coverage"

make -j $(nproc)

make check-gcc RUNTESTFLAGS="old-deja.exp=g++.other/rtti4.C"

can you please let me know, whether its potential bug or any  flags(or)
configuration need to be added.

even, i have by tried passing -lgcov flag in LDFLAGS but still getting the same
error.

thanks,
Harish

Reply via email to