GNOME Bugzilla – Bug 509103
gtk/gnome project template missing "-Wl,--export-dynamic" option
Last modified: 2008-01-16 22:24:16 UTC
When building and running a gtk project user ends up with the error below brian@night-ranger:~/Projects/gtk-salsa/src$ ./gtk-salsa (gtk-salsa:5053): libglade-WARNING **: could not find signal handler 'on_button1_clicked'. (gtk-salsa:5053): libglade-WARNING **: could not find signal handler 'on_window_destroy'. User has to manually add "--export-dynamic" option to project. reference: http://sourceforge.net/mailarchive/forum.php?thread_name=20080112070140.GT21867%40brie.com&forum_name=anjuta-list
Created attachment 102715 [details] [review] Add export-dynamic option to linker Adds export-dynamic option to LDFLAGS to project template This would need to applied to gtk, gtkmm, gnome project templates.
Does this patch cover *all* templates using libglade? If not could you patch them together? Thanks.
I am not completely confident with this patch. Most people do not use signal autoconnection and thus do not really need this option. Shouldn't we add a new button to those project templates that let the user choose whether he wants to use that feature?
To what extend does this flag affect the project? If the effect is small then having it all time (even when there is no use of autoconnect), could be acceptable. From what understand: 1) It mainly affects libraries (unneccessary exports). For executables, it probably doesn't make any difference. We are adding it only in exec targets. 2) Portability. The flag is not portable, however, libtool does its job of transforming it correctly to the right flag. So again may be its not an issue for us. I don't like the idea of yet another switch in project wizards that most new users are going to confuse.
Hmm, the worst thing that can happen is that you overwrite the name of a library method, by for example defining a method gtk_widget_new() somewhere in your program. That's of course unlikely and the compiler will warn you in the case you include a header that defines the same method.
Created attachment 102721 [details] [review] Add export-dynamic option to linker Adds export-dynamic option to LDFLAGS to project template This would need to applied to gtk, gnome project templates. correction: libglademm has no equivalent of autoconnect function.
--export-dynamic appears to be available only for GNU ld, so slapping it into FOO_LDFLAGS is gonna break linking on platforms that have their own ld (darwin, maybe solaris or irix, dunno who else). There are various ways to test whether it's supported in ./configure (either copying the libtool.m4 test for GCC ld (which is how libtool itself appears to determine whether to use --export-dynamic) or else simply do a direct linker test with that flag).
> --export-dynamic appears to be available only for GNU ld, > I read somewhere that libtool will take care of substituting it with appropriate flag. Isn't that true?
Anyways the flags are in generated projects and the users can remove it anytime. So no big deal.