On Mon, Jul 20, 2009 at 11:22:32AM -0700, Alan Irwin wrote: > Hi Andrew: > > I have changed the subject line appropriately. > > On 2009-07-20 15:55+0100 Andrew Ross wrote: > >> Slightly off topic - I've now got gcc -fvisibility=hidden working with >> the qt driver and with the C++ qt_example.cpp. It does not work with >> the pyqt4 bindings yet. There are a couple of issues here (I think). >> 1) The sip generated code does not export the symbols that python >> requires. It should be possible to massage the source code if required. >> 2) The moc generated code for qt also is not visibility aware and I >> think this is what is leading to the missing symbols in plplot_pyqt4.so >> at the moment. I've not yet worked out how (or indeed even if it is >> possible) to massage the code by hand to "fix" this. > > Thanks very much for dealing with the visibility issues caused by splitting > the old qt.cpp source code into qt.cpp and plqt.cpp. I have now added one > additional cleanup there (revision 10167) to remove some unneeded logic in > pldll.h.in. > > I agree with your comment (1) above that the visibility of the symbols > defined in plplot_pyqt4.so will be an issue when python attempts to > dynamically load that shared object. But I believe the first priority is to > deal with the remaining unexported symbols in libplplotqtd.so that are > causing undefined symbols for plplot_pyqt4.so. > > The current undefined symbol status is as follows. > > softw...@raven> ldd -r drivers/qt.so 2>&1 |grep undefined > softw...@raven> ldd -r bindings/qt_gui/libplplotqtd.so 2>&1 |grep undefined > softw...@raven> ldd -r bindings/qt_gui/pyqt4/plplot_pyqt4.so 2>&1 |grep > undefined > undefined symbol: _ZTI11QtExtWidget > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: _ZTI10QtPLWidget > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: _ZN11QtExtWidget16staticMetaObjectE > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: _ZN10QtPLWidget16staticMetaObjectE > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: _ZN10QtPLWidget11qt_metacastEPKc > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: > _ZN11QtExtWidget11qt_metacallEN11QMetaObject4CallEiPPv(bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: _ZN10QtPLWidget11qt_metacallEN11QMetaObject4CallEiPPv > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > undefined symbol: _ZN11QtExtWidget11qt_metacastEPKc > (bindings/qt_gui/pyqt4/plplot_pyqt4.so) > > I have double-checked that all these eight symbols are defined in but not > exported from libplplotqtd. You are probably aware of this already, but I > just discovered you can correlate these symbols with the demangled symbols > using the appropriate nm options and grep. For example: > > softw...@raven> nm --defined-only bindings/qt_gui/libplplotqtd.so |grep > _ZTI11QtExtWidget > 0000000000214b50 d _ZTI11QtExtWidget > softw...@raven> nm --defined-only --demangle bindings/qt_gui/libplplotqtd.so > |grep 0000000000214b50 > 0000000000214b50 d typeinfo for QtExtWidget > > That demangled symbol information for all eight symbols may help you to > figure out what is really going on with visibility. > > I am curious about your comment (2) above. Is there an example of a > externally required symbol in the generated moc_qt.cxx that cannot be > exported by some qt.h change involving the PLDLLIMPEXP_QT macro?
Alan, I've also done the same thing with ldd / nm. I get the same missing symbols as you. When you run moc it generates some extra functions in the the C++ class to deal with the qt signals / slots. The Q_OBJECT line in the C++ classes denotes the classes that this applies to. If you look through qt.h you will see that there are unexported typeinfo information for _only_ those classes which contain Q_OBJECT, even though everything else is that same (e.g. c.f. the typeinfo entries for QtPLDriver and QTPLWidget). The other entries, those containing metaObject or metacast are generated by moc (look in the source file). I've tried manually adding in the required attribute information to these files but it doesn't compile. It seems that these are being defined elsewhere through QT macros - I imagine an expansion of the Q_OBJECT tag - and the definitions conflict. I will need to look into this further. I'm not quite sure why this only affects the pyqt4 bindings. Presumable qt.cpp is not using the typeinfo information. Andrew ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel