Opened 17 years ago

Closed 17 years ago

#2216 closed defect (fixed)

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 (4)

comment:1 by dmorissette, 17 years ago

Status: newassigned

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

comment:2 by hobu, 17 years ago

Cc: sdlime added

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

comment:3 by dmorissette, 17 years ago

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.

comment:4 by dmorissette, 17 years ago

Resolution: fixed
Status: assignedclosed

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.