gcov broken on gcc 4.2.1 (Xcode 3.2.2) with iPhone or 10.5SDK

Number:rdar://8052323 Date Originated:6/2/2010
Status:open Resolved:
Product:Developer Tools Product Version:3.2.2
Classification:Serious Bug Reproducible:Always
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:

Undefined symbols:
 "_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:


Please note: 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!