Skip to contentSkip to conversation

LTP fails to build for Application Code Coverage

LTP Subrata Modak 3 participants 3 messages Oct 30, 2009

lore
Share & tools
lore
#0 lore raw

Hi Peter,

I was just trying to build LTP for finding itś own code coverage, but with the GCC options mentioned in lcov/INSTALL, i get the following build failure. Is there something i am missing:

# ./configure
# make CFLAGS=\ -fprofile-arcs\ -ftest-coverage\ -Wall
gcc -fprofile-arcs -ftest-coverage -Wall   -c -o ltp-pan.o ltp-pan.c
ltp-pan.c: In function ‘main’:
ltp-pan.c:484: warning: call to function ‘wait_handler’ without a real
prototype
zoolib.h:52: note: ‘wait_handler’ was declared here
ltp-pan.c:550: warning: call to function ‘wait_handler’ without a real
prototype
zoolib.h:52: note: ‘wait_handler’ was declared here
ltp-pan.c:559: warning: call to function ‘wait_handler’ without a real
prototype
zoolib.h:52: note: ‘wait_handler’ was declared here
ltp-pan.c:574: warning: call to function ‘wait_handler’ without a real
prototype
zoolib.h:52: note: ‘wait_handler’ was declared here
gcc -fprofile-arcs -ftest-coverage -Wall   -c -o zoolib.o zoolib.c
gcc -fprofile-arcs -ftest-coverage -Wall   -c -o splitstr.o splitstr.c
gcc   ltp-pan.o zoolib.o splitstr.o -lm  -o ltp-pan
ltp-pan.o: In function `run_child':
ltp-pan.c:(.text+0x6d54): undefined reference to `__gcov_fork'
ltp-pan.c:(.text+0x7bda): undefined reference to `__gcov_execlp'
ltp-pan.c:(.text+0x7e15): undefined reference to `__gcov_execvp'
ltp-pan.o: In function `global constructors keyed to 65535_0_Debug':
ltp-pan.c:(.text+0xaf79): undefined reference to `__gcov_init'
ltp-pan.o:(.data+0x44): undefined reference to `__gcov_merge_add'
zoolib.o: In function `global constructors keyed to
65535_0_zoo_getname':
zoolib.c:(.text+0x29ab): undefined reference to `__gcov_init'
zoolib.o:(.data+0x24): undefined reference to `__gcov_merge_add'
splitstr.o: In function `global constructors keyed to 65535_0_splitstr':
splitstr.c:(.text+0x565): undefined reference to `__gcov_init'
splitstr.o:(.data+0x24): undefined reference to `__gcov_merge_add'
collect2: ld returned 1 exit status
make[1]: *** [ltp-pan] Error 1
make[1]: Leaving directory `/root/subrata/ltp/ltp-full-20090930/pan'
make: *** [all] Error 2

And this is running on a gcov enabled kernel.

# gcc --version
gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
# rpm -qa | grep -i gcc
gcc43-info-4.3.3_20081022-11.18
gcc43-c++-4.3.3_20081022-11.18
gcc43-debuginfo-4.3.3_20081022-11.18
libgcc43-4.3.3_20081022-11.18
gcc-info-4.3-62.198
gcc43-locale-4.3.3_20081022-11.18
gcc-c++-4.3-62.198
gcc33-debuginfo-3.3.3-11.9
gcc-locale-4.3-62.198
gcc43-4.3.3_20081022-11.18
gcc-4.3-62.198

Regards--
Subrata

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

Hi Subrata,

Quoted 1 line · Subrata Modak
# make CFLAGS=\ -fprofile-arcs\ -ftest-coverage\ -Wall

[...]

Quoted 3 lines

gcc ltp-pan.o zoolib.o splitstr.o -lm -o ltp-pan
ltp-pan.o: In function `run_child':
ltp-pan.c:(.text+0x6d54): undefined reference to `__gcov_fork'

we already solved this issue via ST but I'll still post the result here for reference: to prevent this particular error, you'll need to also provide the additional linker option -coverage.

As not all ltp Makefile work well when specifying CFLAGS and LDFLAGS on the make command line, you'll need to specify those during the configure step, i.e.

./configure CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-coverage" make

Regards,
Peter

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 13 lines · Peter Oberparleiter

Hi Subrata,

Quoted 1 line · Subrata Modak
# make CFLAGS=\ -fprofile-arcs\ -ftest-coverage\ -Wall

[...]

Quoted 3 lines

gcc   ltp-pan.o zoolib.o splitstr.o -lm  -o ltp-pan ltp-pan.o: In function `run_child':
ltp-pan.c:(.text+0x6d54): undefined reference to `__gcov_fork'

we already solved this issue via ST but I'll still post the result here for reference: to prevent this particular error, you'll need to also provide the additional linker option -coverage.

Quoted 6 lines

As not all ltp Makefile work well when specifying CFLAGS and LDFLAGS on the make command line, you'll need to specify those during the configure step, i.e.

./configure CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-coverage" make

Correct. I updated INSTALL to explicitly state `do not define
CFLAGS, CPPFLAGS, etc' on the command line with make. People need to either specify the right values to configure, and/or modify the values in include/mk/config.mk (which gets produced by configure). Thanks,
-Garrett

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list