Ticket #2216 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

undefined symbol __gcov_merge_add with php_mapscript.so built with --enable-coverage

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.0 release
Component: MapScript-PHP Version: svn-trunk (development)
Severity: normal Keywords:
Cc: sdlime

Description

If MapServer is configured with the --enable-coverage configure option then we get the following error when we try to load it:

Warning: dl() [function.dl]: Unable to load dynamic library 
'/opt/fgs1/fgs/www/lib/php5/php_mapscript_499.so' - /opt/fgs1/fgs/www/lib/php5/php_mapscript_499.so: 
undefined symbol: __gcov_merge_add in .../gmap75.phtml on line 54

Change History

Changed 6 years ago by dmorissette

  • status changed from new to assigned

It seems that this issue is not new and already existed in previous releases, or at least in 4.10 according to this message:

 http://lists.umn.edu/cgi-bin/wa?A2=ind0610&L=MAPSERVER-USERS&P=53290

Changed 6 years ago by hobu

  • cc sdlime added

Does anyone use --enable-coverage anymore now that we have valgrind? We should drop it if we can...

Changed 6 years ago by dmorissette

I presume --enable-coverage provides a different type of information than Valgrind? Or does Valgrind do code coverage as well?

Back to the issue, it seems to be that g++ is used to link php_mapscript.so and it doesn't link in the libgcov.a symbols.

I found that I can get a working build by modifying the mapscript/php3/Makefile to either:

1- Add "-lgcov" to MS_LIBS

or

2- Add the "-fprofile-arcs -ftest-coverage" args to the LD command

I have a patch for configure.in that does option 2 above ready to commit that works at least for gcc or g++, but it may not work if the linker is a more traditional ld for instance.

Changed 6 years ago by dmorissette

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r6526.

The configure script adds "-fprofile-arcs -ftest-coverage" args to the LD command in mapscript/php3/Makefile if --enable-coverage is selected.

Note: See TracTickets for help on using tickets.