gcov broken on gcc 4.2.1 (Xcode 3.2.2) with iPhone or 10.5SDK
Normally to set up code coverage on Xcode, you turn on the "Instrument Program Flow" (-fprofile-arcs) and "Generate Test Coverage Files" (-ftest-coverage) flags, and add libgcov (-lgcov). When you build on the iPhone/10.5SDK using gcc 4.2.1, the stock libgcov included with gcc 4.2.1 has references to vproc_transaction_begin and vproc_transaction_end. These routines are defined in the 10.6 runtime (crt1.10.6.o) but are not defined in the 10.5 runtime (the iPhone SDKs, at least up to iPhone SDK 3.2, depend on the 10.5 runtime) so you receive:
"_vproc_transaction_end", referenced from:
_gcov_exit in libgcov.a(_gcov.o)
_vproc_transaction_end$non_lazy_ptr in libgcov.a(_gcov.o)
(maybe you meant: _vproc_transaction_end$non_lazy_ptr)
"_vproc_transaction_begin", referenced from:
___gcov_init in libgcov.a(_gcov.o)
_vproc_transaction_begin$non_lazy_ptr in libgcov.a(_gcov.o)
(maybe you meant: _vproc_transaction_begin$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
More details about this issue here:
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!