openexr: make architecture independent
[oi-userland.git] / components / library / glib / patches / 02-gmodule-always-lazy.patch
blobbde4c0720684a3b11a88b67e5311a3a60888ec71
1 Patch migrated from Desktop, where it was listed as:
2 # owner:laca type:bug date:2005-10-13
4 After talking with Rod, it seems like this should apply to all platforms;
5 not just Solaris, otherwise there could be a significant performance
6 penalty at startup. Need to file upstream bug for that.
8 diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c
9 index c1c2fce..d71595e 100644
10 --- a/gmodule/gmodule-dl.c
11 +++ b/gmodule/gmodule-dl.c
12 @@ -133,10 +133,18 @@ _g_module_open (const gchar *file_name,
13 GError **error)
15 gpointer handle;
17 +#if defined(__sun) && defined(__SVR4)
18 + /*
19 + * Always use RTLD_LAZY on Solaris; otherwise all relocations are performed
20 + * immediately in all dynamic dependencies.
21 + */
22 + bind_lazy = 1;
23 +#endif
25 lock_dlerror ();
26 handle = dlopen (file_name,
27 - (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
28 + (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY | RTLD_FIRST : RTLD_NOW));
29 if (!handle)
31 const gchar *message = fetch_dlerror (TRUE);