Did you accidently submit the bug report without any message?
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
(In reply to sadineniharish8446 from comment #2) > 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" Yes this is not going to work as you are compiling libgcc with -ftest-coverage which will almost never work. you just need either --enable-coverage or --enable-coverage=opt .
we ate trying to take coverage for libstdc++, I have tried following configuration options but getting same error. ../configure --enable-languages=c,c++ - --disable-bootstrap --disable-multilib CFLAGS="-ftest-coverage -fprofile-arcs" CXXFLAGS="-ftest-coverage -fprofile-arcs " LDFLAGS="--coverage" can you please let me know which configuration will work. thanks, Harish
(In reply to sadineniharish8446 from comment #4) > we ate trying to take coverage for libstdc++, I have tried following > configuration options but getting same error. > > ../configure --enable-languages=c,c++ - --disable-bootstrap > --disable-multilib CFLAGS="-ftest-coverage -fprofile-arcs" > CXXFLAGS="-ftest-coverage -fprofile-arcs " LDFLAGS="--coverage" > > > can you please let me know which configuration will work. Try setting CXXFLAGS_FOR_TARGET only. Note this is not the right place to get help like this. gcc@ (and libstdc++@) mailing list are better places to ask for help on getting this working and only filing a bug if there is no way in the end.