After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 509103 - gtk/gnome project template missing "-Wl,--export-dynamic" option
gtk/gnome project template missing "-Wl,--export-dynamic" option
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: project-wizard
2.2.0
Other Linux
: Normal trivial
: ---
Assigned To: Sébastien Granjoux
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-13 08:57 UTC by Ritesh Khadgaray ( irc:ritz)
Modified: 2008-01-16 22:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add export-dynamic option to linker (309 bytes, patch)
2008-01-13 09:01 UTC, Ritesh Khadgaray ( irc:ritz)
none Details | Review
Add export-dynamic option to linker (1.04 KB, patch)
2008-01-13 11:38 UTC, Ritesh Khadgaray ( irc:ritz)
committed Details | Review

Description Ritesh Khadgaray ( irc:ritz) 2008-01-13 08:57:30 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
Comment 1 Ritesh Khadgaray ( irc:ritz) 2008-01-13 09:01:20 UTC
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.
Comment 2 Naba Kumar 2008-01-13 10:22:10 UTC
Does this patch cover *all* templates using libglade? If not could you patch them together? Thanks.
Comment 3 Johannes Schmid 2008-01-13 10:46:52 UTC
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? 
Comment 4 Naba Kumar 2008-01-13 11:04:04 UTC
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.
Comment 5 Johannes Schmid 2008-01-13 11:23:06 UTC
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.
Comment 6 Ritesh Khadgaray ( irc:ritz) 2008-01-13 11:38:36 UTC
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.
Comment 7 Daniel Macks 2008-01-14 06:38:49 UTC
--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).
Comment 8 Naba Kumar 2008-01-15 22:13:01 UTC
> --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?
Comment 9 Naba Kumar 2008-01-16 22:24:16 UTC
Anyways the flags are in generated projects and the users can remove it anytime. So no big deal.