On Sat, Sep 06, 2008 at 09:00:22PM +0100, Andrew Ross wrote: > On Fri, Sep 05, 2008 at 05:56:02PM -0700, Alan Irwin wrote: > > Revision 8753 makes infrastructure available to > > play with gcc-4.x visibility following what was done for the Windows > > compiler > > cases and following the ideas in http://gcc.gnu.org/wiki/Visibility. > > > > The idea here is any symbol marked as PLDLLIMPEXP is definitely exported, > > but the other symbols visibility is either default (exported) or hidden > > depending on how whether the gcc visibility pragma is either pushed as > > "(default)" (which was committed so the export situation remains the same as > > before, i.e., all symbols are exported) or "(hidden)". To get the latter > > behaviour, change what is commented out for the pragma in include/plplot.h. > > > > There is a problem with the "(hidden)" case. Here is the libplplotd > > result: > > > > nm -a src/libplplotd.so |grep ' t ' |grep ' c_' > > 00000000000205c3 t c_plcol0 > > 0000000000045e74 t c_plenvi > > 000000000001f893 t c_plgfci > > 0000000000023d1c t c_plgra > > 000000000002280c t c_plscmap0n > > 0000000000020a02 t c_plscol0 > > 000000000001c91c t c_plsdiori > > 0000000000023de5 t c_pltext > > > > So for some reason those particular symbols are local rather than exported. > > OTOH, c_plcol1, for example is a "T" which means it is exported properly. > > Currently I cannot spot any differences between e.g., the way plcol0 and > > plcol1 are treated in our source code for libplplot. Can somebody clue me > > in about that? > > > > Until we get this sorted out we should continue to use the "(default)" > > pragma rather than the "(hidden)" one in the committed version of plplot.h, > > but certainly feel free to experiment locally with the "(hidden)" version. > > Alan, > > I've tested the "(hidden)" version with gcc 4.2.3 on Ubuntu (intel 32 > bit) and I can confirm a similar issue with some (but not all) symbols > being local exported. I have a rather longer list than you though which > is odd and suggests it may not just be a problem with our source. > > I also encountered a problem with the python module. Linking > _plplotcmodule.so fails with all the plplot library symbols giving > undefined references, not just those marked "t". Similar problems > occurs with tcl, gnome2 and ocaml. Linking the fortran, octave and > ada libraries was successful though. > > Once I started on the drivers these also all began to fail with > undefined references and also an ld error along the line of > > /usr/bin/ld: ps.so: hidden symbol `c_plsdiori' isn't defined > /usr/bin/ld: final link failed: Nonrepresentable section on output > collect2: ld returned 1 exit status > > At this point I gave up the experiment. > > I will investigate further as time allows.
A further data point. I tried on an older Ubuntu (64-bit) system with gcc 4.1.2. This failed to even compile the libraries. Error when linking is plcore.o: relocation R_X86_64_PC32 against `c_pltext' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value I suspect this might be a gcc bug though. With earlier gcc versions there appear to have been some problems. Mozilla showed up some of these according to a google search. I will concentrate on gcc 4.2.x for now. A quick look suggests some implementational issues with the gcc visibility stuff. The #pragma statements are at the beginning / end of plplot.h. This means anything defined elsewhere (for example in plplotP.h) will be public by default. Functions only defined in source files will also be public unless otherwise marked. Since everything in plplot.h is actually marked to be exported then changing the #pragma statements should have no effect at all, but it does! Anyway this shouldn't be the cause of the problem, although it will need fixing. This is actually slightly tricky without scattering #pragma statements throughout the source code. I guess eventually explicitly marking all functions as visibility default or hidden is the answer (as suggested in the wiki page). It might be worth trying compiling with -fvisibility=hidden too. Andrew ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel