This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building gcc with --coverage


On 2012-04-20 16:18, David Tengeri wrote:
Hello,

I want to measure the test coverage of gcc based on the tests shipped with it. To accomplish this, I tried to compile gcc 4.6.2 with the --coverage flag. But I got some errors and I don't know how to handle them. I googled it, but I didn't find any useful information, maybe somebody can help me.

I tried to compile gcc on 3 different systems. On my desktop, which runs a 64-bit Arch Linux, and I made a 32-bit Arch Linux and a 32-bit Debian 6.0 virtual machine on VirtualBox.

The normal builds are OK.

The configure command I've used on both systems:
../gcc_4_6_2/configure --prefix="/home/dtengeri/install/" --enable-languages="c,c++" CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs -ftest-coverage"


[configure-stage1-target-libgomp] Error 77
The config.log says:
/home/dtengeri/build/./gcc/cc1: symbol lookup error: /home/dtengeri/build/./gcc/libgcc_s.so.1: undefined symbol: atexit


atexit is defined in glibc. I have version 2.15-10 of glibc on my system. I've tried to pass -lc to LDFLAGS, but it didn't help.

Next I added --disable-shared parameter to the configure. In this case the build process reached stage 2.
The compile stopped at configuring libiberty, because it can't find gcov related functions. So I modified the makefile and add the -fprofile-arcs flag to the XGCC_FLAGS_FOR_TARGET variable. After this the compile continued, but a segmentation fault occured at stage 2, at one of the configure of libgcc.


The second try was on a 32-bit Arch Linux running on VirtualBox. I got the same problem here. It missed the fstat() symbol without --disable-shared parameter and there was a segmentation fault with the --disable-shared parameter.

My third attempt was on the Debian.
I had to make the change of XGCC_FLAGS_FOR_TARGET in the Makefile here too.


First, the compile stopped when trying to configure libiberty at stage 2.It stopped at the checking for working fork. I left it for hours but nothing changed, it still wanted to check for working fork. So I changed the configure script in libiberty to bypass this check. The same error happened with gcc, so I modified the gcc/configure script too.
The next stop in the build process was the following command:
echo | /home/dtengeri/build/./gcc/xgcc -B/home/dtengeri/build/./gcc/ -E -dM - | \
sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
-e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
sort -u > tmp-macro_list


And this command didn't finish its job. I left it for a day. At the end of the day it allocates all of the memory on the virtual machine and used its cpu on 100%.

The situation is the same with --disable-shared on and off.

So I'm stucked here and I don't know what to do next.

Does anybody has any expreience in building gcc with --coverage option?

Regards,
David Tengeri

Ok, now I know this was a dumb question. There is --enable-coverage configure option, which does the same I want.... Now it compiles fine.

Regards,
David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]