diff options
author | Colin Walters <walters@verbum.org> | 2012-10-24 16:58:10 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-10-24 18:20:32 -0400 |
commit | 3a0531d84af702e4c8aed7801d9455cc95f3cb4a (patch) | |
tree | 4158235fffad402e80472f9040a011d06073c84c /gdk-pixbuf/queryloaders.c | |
parent | 19adb79f13ff129289e54123adea368b307990ef (diff) | |
download | gdk-pixbuf-3a0531d84af702e4c8aed7801d9455cc95f3cb4a.tar.gz |
queryloaders: Ensure we link to libgobject
This call is necessary to ensure we actually link against libgobject;
otherwise it may be stripped if -Wl,--as-needed is in use.
The reason we need to link against libgobject is because it now has
a global constructor. If the dynamically loaded modules happen
to dlclose() libgobject, then reopen it again, we're in for trouble.
See https://bugzilla.gnome.org/show_bug.cgi?id=686822
Patch-suggested-by: Ryan Lortie <desrt@desrt.ca>
Signed-off-by: Colin Walters <walters@verbum.org>
https://bugzilla.gnome.org/show_bug.cgi?id=686822
Diffstat (limited to 'gdk-pixbuf/queryloaders.c')
-rw-r--r-- | gdk-pixbuf/queryloaders.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c index 6087bd8be..6246dd638 100644 --- a/gdk-pixbuf/queryloaders.c +++ b/gdk-pixbuf/queryloaders.c @@ -312,6 +312,17 @@ int main (int argc, char **argv) #endif + /* This call is necessary to ensure we actually link against libgobject; + * otherwise it may be stripped if -Wl,--as-needed is in use. + * + * The reason we need to link against libgobject is because it now has + * a global constructor. If the dynamically loaded modules happen + * to dlclose() libgobject, then reopen it again, we're in for trouble. + * + * See: https://bugzilla.gnome.org/show_bug.cgi?id=686822 + */ + g_type_ensure (G_TYPE_OBJECT); + if (argc > 1 && strcmp (argv[1], "--update-cache") == 0) { cache_file = gdk_pixbuf_get_module_file (); first_file = 2; |