Hi, I am porting some f90 software from a Fedora 4/PGI 6.1/ld 2.15.94 system to a Fedora 7/PGI 7.1/ld 2.17.50 system and, when building f90 applications with automake/autoconf/libtool, I have problems with debugging symbols on shared libraries: I link an application with a library created by myself and if the library and the application are both compiled with -g option, at link time I get (simplifying command line):
pgf90 -g -o .libs/shp_test shp_test.f90 ./.libs/libshp-fortran.so -lshp
shp_test.f90:
shp_test.o:(.debug_info+0x13e): undefined reference to `..Dm_shplib'
where:
objdump -t ./.libs/libshp-fortran.so|grep Dm_shplib
00000189 l .debug_info 00000000 ..Dm_shplib_def
000006fb l .debug_info 00000000 ..Dm_shplib
If I link with the corresponding static library .a, whose build differs only in the absence of the -fPIC option and for which (notice g instead of l ?!):
objdump -t ./.libs/libshp-fortran.a|grep Dm_shplib
0000005b g .debug_info 00000000 ..Dm_shplib_def
000005cd g .debug_info 00000000 ..Dm_shplib
the linking is successful.
The linking with shared library on the old system gave just a warning and then everything worked, fine, including debugging:
/usr/bin/ld: warning: type and size of dynamic symbol `..Dm_shplib' are not defined
and:
objdump -t ./.libs/libshp-fortran.a|grep Dm_shplib
00000069 g .debug_info 00000000 ..Dm_shplib_def
00000488 g .debug_info 00000000 ..Dm_shplib
objdump -t ./.libs/libshp-fortran.so|grep Dm_shplib
00000501 g .debug_info 00000000 ..Dm_shplib
000000e2 g .debug_info 00000000 ..Dm_shplib_def
Is this a problem of the new linker or of the new PGI compiler suite? Can any command line switch help? I can make more tests and provide more information if needed.
thank you, Davide