[gcompris-devel] Performance issues

Thomas Petazzoni thomas.petazzoni at enix.org
Tue Oct 2 15:40:53 UTC 2007


Hi,

Le Sun, 30 Sep 2007 17:57:59 +0300,
Terje Bergström <terje at terje.fi> a écrit :

> --- gcompris-8.4.orig/src/gcompris/gcompris.c
> +++ gcompris-8.4/src/gcompris/gcompris.c
> @@ -1896,9 +1896,11 @@
>    /* FIXME: HACK Needed or we have unresolved symbols at python
> plugin dlopen
>     *        Is there a better way to fix these?
>     */
> -  GType dummy = gnome_canvas_polygon_get_type();
> -  dummy = gnome_canvas_clipgroup_get_type();
> -  dummy = gnome_canvas_bpath_get_type();
> +  volatile GnomeCanvasItem *dummy = NULL;
> +  GNOME_IS_CANVAS_POLYGON(dummy);
> +  GNOME_IS_CANVAS_CLIPGROUP(dummy);
> +  GNOME_IS_CANVAS_BPATH(dummy);
> +  GNOME_TYPE_CANVAS_POLYGON();

Instead of doing that to make sure that all symbols used by dlopen()
libraries are in the gcompris binary, it would probably be interesting
to try the -export-dynamic option of "ld".

Extract from
http://sourceware.org/binutils/docs-2.18/ld/Options.html#Options

=====================================================================

-E
--export-dynamic

    When creating a dynamically linked executable, add all symbols to
the dynamic symbol table. The dynamic symbol table is the set of
symbols which are visible from dynamic objects at run time.

    If you do not use this option, the dynamic symbol table will
normally contain only those symbols which are referenced by some
dynamic object mentioned in the link.

    If you use dlopen to load a dynamic object which needs to refer
back to the symbols defined by the program, rather than some other
dynamic object, then you will probably need to use this option when
linking the program itself.

    You can also use the dynamic list to control what symbols should be
added to the dynamic symbol table if the output format supports it. See
the description of `--dynamic-list'.
=====================================================================

Sincerly,

Thomas
-- 
Thomas Petazzoni - thomas.petazzoni at enix.org
http://{thomas,sos,kos}.enix.org - http://www.toulibre.org
http://www.{livret,agenda}dulibre.org




More information about the Gcompris-devel mailing list