diff options
| author | Colin Walters <walters@verbum.org> | 2012-10-24 20:58:10 (GMT) |
|---|---|---|
| committer | Colin Walters <walters@verbum.org> | 2012-10-24 22:20:32 (GMT) |
| commit | 3a0531d84af702e4c8aed7801d9455cc95f3cb4a (patch) | |
| tree | 4158235fffad402e80472f9040a011d06073c84c | |
| parent | 19adb79f13ff129289e54123adea368b307990ef (diff) | |
| download | gdk-pixbuf-3a0531d84af702e4c8aed7801d9455cc95f3cb4a.zip gdk-pixbuf-3a0531d84af702e4c8aed7801d9455cc95f3cb4a.tar.xz | |
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
| -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 6087bd8..6246dd6 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; |